-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93d0976
commit 9e4e4a8
Showing
1 changed file
with
30 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,24 @@ | ||
# What is Friendica? | ||
|
||
Friendica is a decentralised communications platform that integrates social communication. | ||
Our platform links to independent social projects and corporate services. | ||
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/friendica/docker/9c954f4d/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 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 `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. | ||
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. | ||
|
||
[![Try in PWD](https://github.com/play-with-docker/stacks/raw/cff22438cb4195ace27f9b15784bbb497047afa7/assets/images/button.png)](http://play-with-docker.com?stack=https://raw.githubusercontent.com/nupplaphil/friendica-docker/fec33c98be957436279b7074ca08068b18622627/stack.yml) | ||
(Admin-E-Mail: `[email protected]`) | ||
[![Try in PWD](https://github.com/play-with-docker/stacks/raw/cff22438cb4195ace27f9b15784bbb497047afa7/assets/images/button.png)](http://play-with-docker.com?stack=https://raw.githubusercontent.com/nupplaphil/friendica-docker/fec33c98be957436279b7074ca08068b18622627/stack.yml) (Admin-E-Mail: `[email protected]`) | ||
|
||
## 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: | ||
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/server | ||
|
@@ -36,20 +28,13 @@ Now you can access the Friendica installation wizard at http://localhost:8080/ f | |
|
||
## 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. | ||
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/server: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. | ||
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 the cron job | ||
|
||
|
@@ -62,6 +47,7 @@ There are three options to enable the cron-job for Friendica: | |
## Possible Environment Variables | ||
|
||
**Friendica Settings** | ||
|
||
- `FRIENDICA_ADMIN_MAIL` E-Mail address of the administrator. | ||
- `FRIENDICA_TZ` The default localization of the Friendica server. | ||
- `FRIENDICA_LANG` The default language of the Friendica server. | ||
|
@@ -72,11 +58,13 @@ There are three options to enable the cron-job for Friendica: | |
- `FRIENDICA_DATA_DIR` The data directory of the Friendica server (Default: /var/www/data). | ||
|
||
**Friendica Logging** | ||
|
||
- `FRIENDICA_DEBUGGING` If set to `true`, the logging of Friendica is enabled. | ||
- `FRIENDICA_LOGFILE` (optional) The path to the logfile (Default: /var/www/friendica.log). | ||
- `FRIENDICA_LOGLEVEL` (optional) The loglevel to log (Default: notice). | ||
|
||
**Database** (**required at installation**) | ||
|
||
- `MYSQL_USERNAME` Username for the database user using mysql. | ||
- `MYSQL_USER` Username for the database user using mariadb. | ||
- `MYSQL_PASSWORD` Password for the database user using mysql / mariadb. | ||
|
@@ -85,12 +73,14 @@ There are three options to enable the cron-job for Friendica: | |
- `MYSQL_PORT` Port of the database server using mysql / mariadb (Default: `3306`) | ||
|
||
**Lock Driver (Redis)** | ||
|
||
- `REDIS_HOST` The hostname of the redis instance (in case of locking). | ||
- `REDIS_PORT` (optional) The port of the redis instance (in case of locking). | ||
- `REDIS_PW` (optional) The password for the redis instance (in case of locking). | ||
- `REDIS_DB` (optional) The database instance of the redis instance (in case of locking). | ||
|
||
**Develop/Release Candidat Settings** | ||
|
||
- `FRIENDICA_UPGRADE` If set to `true`, a develop or release candidat node will get updated at startup. | ||
- `FRIENDICA_REPOSITORY` If set, a custom repository will be chosen (Default: `friendica`) | ||
- `FRIENDICA_ADDONS_REPO` If set, a custom repository for the addons will be chosen (Default: `friendica`) | ||
|
@@ -107,8 +97,7 @@ The binary `ssmtp` is used for the `mail()` support of Friendica. | |
|
||
You have to set the `--hostname/-h` parameter correctly to use the right domainname for the `mail()` command. | ||
|
||
You have to set a valid SMTP-MTA for the `SMTP` environment variable to enable mail support in Friendica. | ||
A valid SMTP-MTA would be, for example, `mx.example.org`. | ||
You have to set a valid SMTP-MTA for the `SMTP` environment variable to enable mail support in Friendica. A valid SMTP-MTA would be, for example, `mx.example.org`. | ||
|
||
The following environment variables are possible for the SMTP examples. | ||
|
||
|
@@ -127,12 +116,9 @@ You have to link a running database container, e. g. `--link my-mysql:mysql`, an | |
|
||
## 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. | ||
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. | ||
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: | ||
|
||
|
@@ -156,9 +142,7 @@ $ docker run -d \ | |
|
||
## Automatic installation | ||
|
||
The Friendica image supports auto configuration via environment variables. | ||
You can preconfigure everything that is asked on the install page on first run. | ||
To enable the automatic installation, there are two possibilities: | ||
The Friendica image supports auto configuration via environment variables. You can preconfigure everything that is asked on the install page on first run. To enable the automatic installation, there are two possibilities: | ||
|
||
### Environment Variables | ||
|
||
|
@@ -172,16 +156,13 @@ You have to set at least the following environment variables (others are optiona | |
|
||
### Using a predefined config file | ||
|
||
You can create a `local.config.php` and `COPY` it to `/usr/src/config`. | ||
If no other environment variable is set, this `local.config.php` will get copied to the config path. | ||
You can create a `local.config.php` and `COPY` it to `/usr/src/config`. If no other environment variable is set, this `local.config.php` will get copied to the config path. | ||
|
||
# Docker Secrets | ||
|
||
More information can be found here https://docs.docker.com/engine/swarm/secrets/. | ||
|
||
As an alternative to passing sensitive information via environment variables, _FILE may be appended to the previously listed environment variables, causing the initialization script to load the values for those variables from files present in the container. | ||
In particular, this can be used to load passwords from Docker secrets stored in /run/secrets/<secret_name> files. | ||
For example: | ||
As an alternative to passing sensitive information via environment variables, _FILE may be appended to the previously listed environment variables, causing the initialization script to load the values for those variables from files present in the container. In particular, this can be used to load passwords from Docker secrets stored in /run/secrets/<secret_name> files. For example: | ||
|
||
```yaml | ||
version: '3.2' | ||
|
@@ -226,41 +207,34 @@ secrets: | |
mysql_password: | ||
file: ./mysql_password.txt # put mysql password to this file using docker-secrets to manage it | ||
``` | ||
Currently, this is only supported for `MYSQL_PASSWORD`. | ||
|
||
# Maintenance of the image | ||
|
||
## Updating to a newer version | ||
|
||
There are differences between the deveop (everything which ends with `-rc` or `-dev`) and the stable (the rest) branches. | ||
There are differences between the develop (everything which ends with `-rc` or `-dev`) and the stable (the rest) branches. | ||
|
||
### Updating stable | ||
|
||
You have to pull the latest image from the hub (`docker pull friendica`). | ||
The stable branch gets checked at every startup and will get updated if no installation was found or a new image is used. | ||
You have to pull the latest image from the hub (`docker pull friendica`). The stable branch gets checked at every startup and will get updated if no installation was found or a new image is used. | ||
|
||
### Updating develop | ||
|
||
You don't need to pull the image for each commit in [friendica](https://github.com/friendica/friendica/). | ||
Instead, the develop branch will get updated if no installation was found or the environment variable `FRIENDICA_UPGRADE` is set to `true`. | ||
You don't need to pull the image for each commit in [friendica](https://github.com/friendica/friendica/). Instead, the develop branch will get updated if no installation was found or the environment variable `FRIENDICA_UPGRADE` is set to `true`. | ||
|
||
It will clone the latest Friendica version and copy it to your working directory. | ||
|
||
# Running this image with docker-compose | ||
|
||
The easiest way to get a fully featured and functional setup is using a `docker-compose` file. | ||
There are too many different possibilities to setup your system, so here are only some examples what you have to look for. | ||
The easiest way to get a fully featured and functional setup is using a `docker-compose` file. There are too many different possibilities to setup your system, so here are only some examples what you have to look for. | ||
|
||
At first make sure you have chosen the right base image (fpm or apache) and added the features you wanted (see below). | ||
In every case you want to add a database container and docker volumes to get easy access to your persistent data. | ||
When you want your server reachable from the internet adding HTTPS-encryption is mandatory! | ||
See below for more information. | ||
At first make sure you have chosen the right base image (fpm or apache) and added the features you wanted (see below). In every case you want to add a database container and docker volumes to get easy access to your persistent data. When you want your server reachable from the internet adding HTTPS-encryption is mandatory! See below for more information. | ||
|
||
## Base version - apache | ||
|
||
This version will use the apache image and add a mariaDB container. | ||
The volumes are set to keep your data persistent. | ||
This setup provides **no ssl encryption** and is intended to run behind a proxy. | ||
This version will use the apache image and add a mariaDB container. The volumes are set to keep your data persistent. This setup provides **no ssl encryption** and is intended to run behind a proxy. | ||
|
||
Make sure to set the variable `MYSQL_PASSWORD` before run this setup. | ||
|
||
|
@@ -305,20 +279,16 @@ Then run `docker-compose up -d`, now you can access Friendica at http://localhos | |
|
||
## Base version - FPM | ||
|
||
When using the FPM image you need another container that acts as web server on port 80 and proxies requests to the Friendica container. | ||
In this example a simple nginx container is combined with the Friendica-fpm image and a MariaDB database container. | ||
The data is stored in docker volumes. | ||
The nginx container also need access to static files from your Friendica installation. | ||
It gets access to all the volumes mounted to Friendica via the `volumes_from` option. | ||
The configuration for nginx is stored in the configuration file `nginx.conf` that is mounted into the container. | ||
When using the FPM image you need another container that acts as web server on port 80 and proxies requests to the Friendica container. In this example a simple nginx container is combined with the Friendica-fpm image and a MariaDB database container. The data is stored in docker volumes. The nginx container also need access to static files from your Friendica installation. It gets access to all the volumes mounted to Friendica via the `volumes_from` option. The configuration for nginx is stored in the configuration file `nginx.conf` that is mounted into the container. | ||
|
||
An example can be found in the [examples section](https://github.com/friendica/docker/tree/master/.examples). | ||
|
||
As this setup does **not include encryption** it should to be run behind a proxy. | ||
|
||
Prerequisites for this example: | ||
- Make sure to set the variable `MYSQL_PASSWORD` before you run the setup. | ||
- Create a `nginx.conf` in the same directory as the docker-compose.yml file (take it from [example](https://github.com/friendica/docker/tree/master/.examples/docker-compose/with-traefik-proxy/mariadb-cron-smtp/fpm/web/nginx.conf)) | ||
|
||
- Make sure to set the variable `MYSQL_PASSWORD` before you run the setup. | ||
- Create a `nginx.conf` in the same directory as the docker-compose.yml file (take it from [example](https://github.com/friendica/docker/tree/master/.examples/docker-compose/with-traefik-proxy/mariadb-cron-smtp/fpm/web/nginx.conf)) | ||
|
||
```yaml | ||
version: '2' | ||
|