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
pull/6329/head
Your Name 3 days ago
parent 8cdfb116e0
commit 5aa529ded4

@ -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

@ -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

Loading…
Cancel
Save