From 761727988960c1f1b8ab700789a1d40fb78a34a6 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 27 Mar 2021 23:43:35 +0100 Subject: [PATCH 1/4] Update README for background tasks --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4fe70cb..a539878 100644 --- a/README.md +++ b/README.md @@ -50,13 +50,14 @@ As the fastCGI-Process is not capable of serving static files (style sheets, ima This can be achieved with the `volumes-from` option. You can find more information in the docker-compose section. -## Using the cron job +## Background tasks -There are three options to enable the cron-job for Friendica: +Friendica requires background tasks to fetch and send all kind of messages and maintain the complete instance. +This setup is crucial for the Friendica node. +There are two options to enable background tasks 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/stable/.examples/dockerfiles/cron) +- Using the default Image and manually setup background tasks (see Friendica [Install](https://github.com/friendica/friendica/blob/2021.03-rc/doc/Install.md#required-background-tasks)) +- Using the default image (apache, fpm, fpm-alpine) and starting a dedicated `cron` instance and use `cron.sh` as startup command (like this [Example](https://github.com/friendica/docker/blob/stable/.examples/docker-compose/insecure/mariadb-cron-redis/apache/docker-compose.yml)) ## Possible Environment Variables From 83dafd7642487770df645d6953c9c493c9949efc Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 27 Mar 2021 23:44:50 +0100 Subject: [PATCH 2/4] Fixing examples - remove supervisord possibility due incompatibility with `tini` - Fix example Dockerfiles --- .examples/README.md | 12 +--------- .../mariadb-cron-redis/apache/app/Dockerfile | 2 +- .../fpm-alpine/app/Dockerfile | 2 +- .../mariadb-cron-redis/fpm/app/Dockerfile | 2 +- .../mariadb-cron-smtp/apache/app/Dockerfile | 4 ++-- .../fpm-alpine/app/Dockerfile | 4 ++-- .../mariadb-cron-smtp/fpm/app/Dockerfile | 4 ++-- .examples/dockerfiles/cron/apache/Dockerfile | 14 ------------ .../dockerfiles/cron/apache/supervisord.conf | 22 ------------------- .examples/dockerfiles/cron/fpm/Dockerfile | 14 ------------ .../dockerfiles/cron/fpm/supervisord.conf | 22 ------------------- 11 files changed, 10 insertions(+), 92 deletions(-) delete mode 100644 .examples/dockerfiles/cron/apache/Dockerfile delete mode 100644 .examples/dockerfiles/cron/apache/supervisord.conf delete mode 100644 .examples/dockerfiles/cron/fpm/Dockerfile delete mode 100644 .examples/dockerfiles/cron/fpm/supervisord.conf diff --git a/.examples/README.md b/.examples/README.md index 7b42478..2411a53 100644 --- a/.examples/README.md +++ b/.examples/README.md @@ -1,22 +1,12 @@ # Examples section In this subfolder are some examples how to use the docker images. -There are two section: +There is currently one section: -* [`dockerfiles`](https://github.com/friendica/docker/tree/stable/.examples/dockerfiles) * [`docker-compose`](https://github.com/friendica/docker/tree/stable/.examples/docker-compose) -The `dockerfiles` are derived images that add or alter certain functionalities of the default docker images. In the `docker-compose` subfolder are examples for deployment of the application. -## Dockerfiles - -The Dockerfiles use the default images as base image and build on top of it. - -Examples | Descriptions --------- | ------- -[cron](https://github.com/friendica/docker/tree/stable/.examples/dockerfiles/cron) | uses supervisor to run the cron job inside the container (so no extra container is needed). - ## docker-compose In `docker-compose` additional services are bundled to create a complex Friendica installation. diff --git a/.examples/docker-compose/insecure/mariadb-cron-redis/apache/app/Dockerfile b/.examples/docker-compose/insecure/mariadb-cron-redis/apache/app/Dockerfile index ad75fc9..66ea6af 100644 --- a/.examples/docker-compose/insecure/mariadb-cron-redis/apache/app/Dockerfile +++ b/.examples/docker-compose/insecure/mariadb-cron-redis/apache/app/Dockerfile @@ -1,4 +1,4 @@ -FROM friendica/server:apache +FROM friendica:apache RUN mkdir -p /usr/src/config COPY addon.config.php /usr/src/config/ diff --git a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm-alpine/app/Dockerfile b/.examples/docker-compose/insecure/mariadb-cron-redis/fpm-alpine/app/Dockerfile index caa1f5a..2b45fea 100644 --- a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm-alpine/app/Dockerfile +++ b/.examples/docker-compose/insecure/mariadb-cron-redis/fpm-alpine/app/Dockerfile @@ -1,4 +1,4 @@ -FROM friendica/server:fpm-alpine +FROM friendica:fpm-alpine RUN mkdir -p /usr/src/config COPY addon.config.php /usr/src/config/ diff --git a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/app/Dockerfile b/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/app/Dockerfile index 5b7fe1d..25c43f3 100644 --- a/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/app/Dockerfile +++ b/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/app/Dockerfile @@ -1,4 +1,4 @@ -FROM friendica/server:fpm +FROM friendica:fpm RUN mkdir -p /usr/src/config COPY addon.config.php /usr/src/config/ diff --git a/.examples/docker-compose/with-traefik-proxy/mariadb-cron-smtp/apache/app/Dockerfile b/.examples/docker-compose/with-traefik-proxy/mariadb-cron-smtp/apache/app/Dockerfile index 60c60c6..08ae513 100644 --- a/.examples/docker-compose/with-traefik-proxy/mariadb-cron-smtp/apache/app/Dockerfile +++ b/.examples/docker-compose/with-traefik-proxy/mariadb-cron-smtp/apache/app/Dockerfile @@ -1,5 +1,5 @@ # Based on .exmples/dockerfiles/smtp/apache -FROM friendica/server:apache +FROM friendica:apache # simple = using an smtp without any credentials (mostly in local networks) # custom = you need to set host, port, auth_options, authinfo (e.g. for GMX support) @@ -9,4 +9,4 @@ ENV SMTP_HOST smtp.example.org COPY *.sh / RUN chmod +x /*.sh -RUN /smtp-config.sh \ No newline at end of file +RUN /smtp-config.sh diff --git a/.examples/docker-compose/with-traefik-proxy/mariadb-cron-smtp/fpm-alpine/app/Dockerfile b/.examples/docker-compose/with-traefik-proxy/mariadb-cron-smtp/fpm-alpine/app/Dockerfile index dae8782..2290b7a 100644 --- a/.examples/docker-compose/with-traefik-proxy/mariadb-cron-smtp/fpm-alpine/app/Dockerfile +++ b/.examples/docker-compose/with-traefik-proxy/mariadb-cron-smtp/fpm-alpine/app/Dockerfile @@ -1,5 +1,5 @@ # Based on .exmples/dockerfiles/smtp/fpm-alpine -FROM friendica/server:fpm-alpine +FROM friendica:fpm-alpine ENV SMTP_HOST smtp.example.org @@ -15,4 +15,4 @@ RUN set -ex; \ # simple = using an smtp without any credentials (mostly in local networks) # custom = you need to set host, port, auth_options, authinfo (e.g. for GMX support) -ENV SMTP_TYPE simple \ No newline at end of file +ENV SMTP_TYPE simple diff --git a/.examples/docker-compose/with-traefik-proxy/mariadb-cron-smtp/fpm/app/Dockerfile b/.examples/docker-compose/with-traefik-proxy/mariadb-cron-smtp/fpm/app/Dockerfile index fcb2911..97fd2c8 100644 --- a/.examples/docker-compose/with-traefik-proxy/mariadb-cron-smtp/fpm/app/Dockerfile +++ b/.examples/docker-compose/with-traefik-proxy/mariadb-cron-smtp/fpm/app/Dockerfile @@ -1,5 +1,5 @@ # Based on .exmples/dockerfiles/smtp/fpm -FROM friendica/server:fpm +FROM friendica:fpm # simple = using an smtp without any credentials (mostly in local networks) # custom = you need to set host, port, auth_options, authinfo (e.g. for GMX support) @@ -9,4 +9,4 @@ ENV SMTP_HOST smtp.example.org COPY *.sh / RUN chmod +x /*.sh -RUN /smtp-config.sh \ No newline at end of file +RUN /smtp-config.sh diff --git a/.examples/dockerfiles/cron/apache/Dockerfile b/.examples/dockerfiles/cron/apache/Dockerfile deleted file mode 100644 index 7fb8cec..0000000 --- a/.examples/dockerfiles/cron/apache/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM friendica/server:apache - -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - supervisor \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - mkdir /var/log/supervisord /var/run/supervisord - -COPY supervisord.conf /etc/supervisor/supervisord.conf - -CMD ["/usr/bin/supervisord"] diff --git a/.examples/dockerfiles/cron/apache/supervisord.conf b/.examples/dockerfiles/cron/apache/supervisord.conf deleted file mode 100644 index 40757b2..0000000 --- a/.examples/dockerfiles/cron/apache/supervisord.conf +++ /dev/null @@ -1,22 +0,0 @@ -[supervisord] -nodaemon=true -logfile=/var/log/supervisord/supervisord.log -pidfile=/var/run/supervisord/supervisord.pid -childlogdir=/var/log/supervisord/ -logfile_maxbytes=50MB ; maximum size of logfile before rotation -logfile_backups=10 ; number of backed up logfiles -loglevel=error - -[program:apache2] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=apache2-foreground - -[program:cron] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=/cron.sh \ No newline at end of file diff --git a/.examples/dockerfiles/cron/fpm/Dockerfile b/.examples/dockerfiles/cron/fpm/Dockerfile deleted file mode 100644 index afb41d0..0000000 --- a/.examples/dockerfiles/cron/fpm/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM friendica/server:fpm - -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - supervisor \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - mkdir /var/log/supervisord /var/run/supervisord - -COPY supervisord.conf /etc/supervisor/supervisord.conf - -CMD ["/usr/bin/supervisord"] diff --git a/.examples/dockerfiles/cron/fpm/supervisord.conf b/.examples/dockerfiles/cron/fpm/supervisord.conf deleted file mode 100644 index 40757b2..0000000 --- a/.examples/dockerfiles/cron/fpm/supervisord.conf +++ /dev/null @@ -1,22 +0,0 @@ -[supervisord] -nodaemon=true -logfile=/var/log/supervisord/supervisord.log -pidfile=/var/run/supervisord/supervisord.pid -childlogdir=/var/log/supervisord/ -logfile_maxbytes=50MB ; maximum size of logfile before rotation -logfile_backups=10 ; number of backed up logfiles -loglevel=error - -[program:apache2] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=apache2-foreground - -[program:cron] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=/cron.sh \ No newline at end of file From d9dbbf3c2bbf43b72d5c1997bbb91be3b788e393 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sun, 28 Mar 2021 00:07:34 +0100 Subject: [PATCH 3/4] Fix Automatic installation README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a539878..a7d2f2e 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,7 @@ 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, you have to the following environment variables: +- `FRIENDICA_URL` The Friendica URL. - `FRIENDICA_ADMIN_MAIL` E-Mail address of the administrator. - `MYSQL_USER` Username for the database user using mysql / mariadb. - `MYSQL_PASSWORD` Password for the database user using mysql / mariadb. From 4ac2b11f4cff97af0c423eafc7c8272805812b33 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sun, 28 Mar 2021 12:08:37 +0200 Subject: [PATCH 4/4] Fix Automatic installation README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a7d2f2e..6f85411 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ There are two options to enable background tasks for Friendica: **Friendica Settings** -- `FRIENDICA_URL` The Friendica URL. +- `FRIENDICA_URL` The Friendica complete URL including protocol, domain and subpath (example: https://friendica.local/sub/ ). - `FRIENDICA_TZ` The default localization of the Friendica server. - `FRIENDICA_LANG` The default language of the Friendica server. - `FRIENDICA_SITENAME` The Sitename of the Friendica server. @@ -156,7 +156,7 @@ 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, you have to the following environment variables: -- `FRIENDICA_URL` The Friendica URL. +- `FRIENDICA_URL` The Friendica complete URL including protocol, domain and subpath (example: https://friendica.local/sub/ ). - `FRIENDICA_ADMIN_MAIL` E-Mail address of the administrator. - `MYSQL_USER` Username for the database user using mysql / mariadb. - `MYSQL_PASSWORD` Password for the database user using mysql / mariadb.