Add service container for executing cron tasks

This commit is contained in:
Ethan Paul 2024-04-10 19:50:22 -04:00
parent 27d78a4822
commit f66e425d35
Signed by: enpaul
GPG Key ID: 9B6D99E4CFA31867
1 changed files with 23 additions and 1 deletions

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