From 5aa529ded4f0691195bdb57f8aabc767fa0e7c48 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 11 Nov 2025 21:52:19 +1100 Subject: [PATCH] Add Laravel scheduler service container - Runs schedule:work in foreground for task scheduling - Uses SIGTERM for graceful shutdown - Includes healthcheck-schedule for monitoring - Follows serversideup/php best practices --- DOCKER_SETUP.md | 1 + docker-compose.yml | 29 +++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/DOCKER_SETUP.md b/DOCKER_SETUP.md index eb6903518..d413bcb8d 100644 --- a/DOCKER_SETUP.md +++ b/DOCKER_SETUP.md @@ -83,6 +83,7 @@ server { - **db:** MariaDB 11 database - **redis:** Redis cache and queue backend - **horizon:** Laravel Horizon queue worker +- **scheduler:** Laravel task scheduler (runs scheduled tasks every minute) ## Volumes diff --git a/docker-compose.yml b/docker-compose.yml index c796e3153..7716049ef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.8' - services: pixelfed: build: @@ -87,6 +85,33 @@ services: networks: - pixelfed-network + scheduler: + build: + context: . + dockerfile: Dockerfile + container_name: pixelfed-scheduler + restart: unless-stopped + command: ["php", "/var/www/html/artisan", "schedule:work"] + stop_signal: SIGTERM + env_file: + - .env + environment: + AUTORUN_ENABLED: "false" + PHP_POST_MAX_SIZE: "500M" + PHP_UPLOAD_MAX_FILE_SIZE: "500M" + PHP_OPCACHE_ENABLE: "1" + volumes: + - ./storage:/var/www/html/storage + - ./bootstrap/cache:/var/www/html/bootstrap/cache + depends_on: + - db + - redis + healthcheck: + test: ["CMD", "healthcheck-schedule"] + start_period: 10s + networks: + - pixelfed-network + networks: pixelfed-network: driver: bridge