[![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/friendica/docker/master/stack.yml) (Admin-E-Mail: `root@friendica.local`)
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).
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
There are three options to enable the cron-job for Friendica:
- Using the default Image and activate the cron-job (see [Installation](https://friendi.ca/resources/installation/), sector `Activating scheduled tasks`)
- Using the default image (apache, fpm, fpm-alpine) and creating **two** container (one for cron and one for the main app)
- Using one of the additional, prepared [`cron dockerfiles`](https://github.com/friendica/docker/tree/master/.examples/dockerfiles/cron)
You have to add the Friendica container to the same network as the running database container, e. g. `--network some-network`, and then use `mysql` as the database host on setup.
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
- Make sure to set the variable `MYSQL_PASSWORD` and `MYSQL_USER` 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))
The `*-dev` and `*-rc` branches are having additional possibilities to get the latest sources of Friendica.
## Possible Environment Variables
The following environment variables are possible for these kind of images too:
**Develop/Release Candidate 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`)
-`FRIENDICA_VERSION` If set, a custom branch will be chosen (Default is based on the chosen image version)
-`FRIENDICA_ADDONS` If set, a custom branch for the addons will be chosen (Default is based on the chosen image version)
## Updating to a newer version
You don't need to pull the image for each commit in [friendica](https://github.com/friendica/friendica/).
Instead, the release candidate or 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.