Add service container for executing cron tasks

This commit is contained in:
Ethan Paul 2024-04-10 19:50:22 -04:00
parent fb6290d01f
commit abea6087e5
Signed by: enpaul
GPG Key ID: 9B6D99E4CFA31867

View File

@ -23,7 +23,10 @@ services:
php-fpm-nextcloud:
container_name: php-fpm-nextcloud
build: ./php-fpm
build:
context: ./php-fpm
tags:
- localhost/php-fpm-nextcloud:latest
volumes:
- ${NEXTCLOUD_DIR}:/var/www/html
- ${DATA_DIR}:/data
@ -54,6 +57,25 @@ services:
networks:
- nextcloud
cron-nextcloud:
container_name: cron-nextcloud
image: localhost/php-fpm-nextcloud:latest
restart: unless-stopped
command:
- bash
- -c
- "'while true; do php --define apc.enable_cli=1 /var/www/html/cron.php && sleep 300; done'"
networks:
- nextcloud
user: www-data
volumes:
- ${NEXTCLOUD_DIR}:/var/www/html
- ${DATA_DIR}:/data
depends_on:
- php-fpm-nextcloud
- redis-nextcloud
- mariadb-nextcloud
networks:
nextcloud:
driver: bridge