2
0
Fork 0
mirror of https://github.com/friendica/docker synced 2024-11-16 07:27:37 +01:00
docker/README.md

82 lines
4.7 KiB
Markdown
Raw Normal View History

# Docker Image for Friendica
This repository holds the official Docker Image for [Friendica](https://friendi.ca)
# What is Friendica?
Friendica is a decentralised communications platform that integrates social communication. Our platform links to independent social projects and corporate services.
![logo](https://cdn.rawgit.com/nupplaphil/friendica-docker/c59f235f/friendica.svg)
# How to use this image
The images are designed to be used in a micro-service environment. There are two types of the image you can choose from.
The `apache` tag contains a full Friendica installation including an apache web server. It is designed to be easy to use and gets you running pretty fast. This is also the default for the `latest` tag and version tags that are not further specified.
The second option is a `fpm` container. It is based on the [php-fpm](https://hub.docker.com/_/php/) image and runs a fastCGI-Process that serves your Friendica server. To use this image it must be combined with any Webserver that can proxy the http requests to the FastCGI-port of the container.
## Using the apache image
You need at least one other mariadb/mysql-container to link it to Friendica
The apache image contains a webserver and exposes port 80. To start the container type:
```console
$ docker run -d -p 8080:80 --link some-mysql:mysql friendica
```
Now you can access the Friendica installation wizard at http://localhost:8080/ from your host system.
## Using the fpm image
To use the fpm image you need an additional web server that can proxy http-request to the fpm-port of the container. For fpm connection this container exposes port 9000. In most cases you might want use another container or your host as proxy.
If you use your host you can address your Friendica container directly on port 9000. If you use another container, make sure that you add them to the same docker network (via `docker run --network <NAME> ...` or a `docker-compose` file).
In both cases you don't want to map the fpm port to you host.
```console
$ docker run -d friendica:fpm
```
As the fastCGI-Process is not capable of serving static files (style sheets, images, ...) the webserver needs access to these files. This can be achieved with the `volumes-from` option. You can find more information in the docker-compose section.
## Using an external database
By default the `latest` container uses a local MySQL-Database for data storage, but the Friendica setup wizard (appears on first run) allows connecting to an existing MySQL/MariaDB database. You can also link a database container, e. g. `--link my-mysql:mysql`, and then use `mysql` as the database host on setup. More info is in the docker-compose section.
## Persistent data
The Friendica installation and all data beyond what lives in the database (file uploads, etc) is stored in the [unnamed docker volume](https://docs.docker.com/engine/tutorials/dockervolumes/#adding-a-data-volume) volume `/var/www/html`. The docker daemon will store that data within the docker directory `/var/lib/docker/volumes/...`. That means your data is saved even if the container crashes, is stopped or deleted.
To make your data persistent to upgrading and get access for backups is using named docker volume or mount a host folder. To achieve this you need one volume for your database container and Friendica.
Friendica:
- `/var/www/html/` folder where all Friendica data lives
```console
$ docker run -d \
-v friendica-vol-1:/var/www/html \
friendica
```
Database:
- `/var/lib/mysql` MySQL / MariaDB Data
```console
$ docker run -d \
-v mysql-vol-1:/var/lib/mysql \
mariadb
```
## Auto configuration via environment variables
The Friendica image supports auto configuration via environment variables. You can preconfigure everything that is asked on the install page on first run.
- `AUTOINSTALL` if `true`, the automatic configuration will start (Default: `false`)
__MYSQL/MariaDB__:
- `MYSQL_USERNAME` Username for the database user using mysql / mariadb.
- `MYSQL_PASSWORD` Password for the database user using mysql / mariadb.
- `MYSQL_DATABASE` Name of the database using mysql / mariadb.
- `MYSQL_HOST` Hostname of the database server using mysql / mariadb.
- `MYSQL_PORT` Port of the database server using mysql / mariadb.
You can also predefine the following `.htconfig.php` values:
- `MAILNAME` E-Mail address of the administrator
- `TZ` The default localization of the Friendica server
- `LANGUAGE` The default language of the Friendica server
- `SITENAME` The default name of the Friendica server
# Questions / Issues
If you got any questions or problems using the image, please visit our [Github Repository](https://github.com/friendica/docker) and write an issue.