From ff6f93640f688f20c19ee66f6e0d1890cc8e192e Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Mon, 11 Jan 2021 09:48:47 +0100 Subject: [PATCH] Added cron job to firefly --- firefly/{firefly.env.example => .env.example} | 0 firefly/Dockerfile | 9 +++++ firefly/db.env.example | 3 -- firefly/docker-compose.yml | 38 ++++++++++--------- 4 files changed, 30 insertions(+), 20 deletions(-) rename firefly/{firefly.env.example => .env.example} (100%) create mode 100644 firefly/Dockerfile delete mode 100644 firefly/db.env.example diff --git a/firefly/firefly.env.example b/firefly/.env.example similarity index 100% rename from firefly/firefly.env.example rename to firefly/.env.example diff --git a/firefly/Dockerfile b/firefly/Dockerfile new file mode 100644 index 0000000..7a0d78f --- /dev/null +++ b/firefly/Dockerfile @@ -0,0 +1,9 @@ +FROM jc5x/firefly-iii:latest + +# Install cron & crontab +RUN apt update && \ +apt install --no-install-recommends -y cron && \ +echo "0 */4 * * * /usr/bin/php /var/www/html/artisan firefly-iii:cron" | crontab + +# Run cron on startup +ENTRYPOINT cron && /usr/local/bin/entrypoint.sh diff --git a/firefly/db.env.example b/firefly/db.env.example deleted file mode 100644 index b291aea..0000000 --- a/firefly/db.env.example +++ /dev/null @@ -1,3 +0,0 @@ -POSTGRES_DB=firefly -POSTGRES_USER=firefly -POSTGRES_PASSWORD=password diff --git a/firefly/docker-compose.yml b/firefly/docker-compose.yml index 1ca4abf..60e5612 100644 --- a/firefly/docker-compose.yml +++ b/firefly/docker-compose.yml @@ -2,36 +2,41 @@ version: '3.3' services: app: - image: jc5x/firefly-iii:latest - restart: always + build: + context: '.' + dockerfile: './Dockerfile' + image: 'firefly-iii-cron:latest' + restart: 'always' depends_on: - - db - - redis + - 'db' + - 'redis' env_file: - - firefly.env + - '.env' labels: - 'com.centurylinklabs.watchtower.enable=true' networks: - - nginx - - default + - 'nginx' + - 'default' volumes: - - upload:/var/www/html/storage/upload + - 'upload:/var/www/html/storage/upload' db: - image: postgres:13-alpine - restart: always + image: 'postgres:13-alpine' + restart: 'always' - env_file: - - db.env + environment: + - 'POSTGRES_DB=$DB_DATABASE' + - 'POSTGRES_PASSWORD=$DB_PASSWORD' + - 'POSTGRES_USER=$DB_USERNAME' labels: - 'com.centurylinklabs.watchtower.enable=true' volumes: - - db-data:/var/lib/postgresql/data + - 'db-data:/var/lib/postgresql/data' redis: - image: redis:6-alpine - restart: always + image: 'redis:6-alpine' + restart: 'always' labels: - 'com.centurylinklabs.watchtower.enable=true' @@ -39,8 +44,7 @@ services: networks: nginx: - external: - name: nginx + external: true volumes: upload: