diff --git a/Dockerfile.scheduler b/Dockerfile.scheduler new file mode 100644 index 0000000..2ffed5e --- /dev/null +++ b/Dockerfile.scheduler @@ -0,0 +1,5 @@ +FROM nginx:alpine + +COPY scripts/video-upload-crontab /etc/crontabs/root + +ENTRYPOINT ["crond", "-f", "-l", "2", "-L", "/dev/stdout"] diff --git a/docker-compose.yml b/docker-compose.yml index 8d05263..b68dd48 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,6 +20,16 @@ services: network_mode: "service:app" restart: unless-stopped + video-upload-scheduler: + build: + context: . + dockerfile: Dockerfile.scheduler + restart: unless-stopped + depends_on: + - app + env_file: + - .env + secret-scan: image: ghcr.io/gitleaks/gitleaks:v8.30.1 profiles: diff --git a/scripts/video-upload-crontab b/scripts/video-upload-crontab new file mode 100644 index 0000000..184fa0f --- /dev/null +++ b/scripts/video-upload-crontab @@ -0,0 +1 @@ +* * * * * wget -q -O /dev/null --header="Authorization: Bearer ${CRON_SECRET}" http://app:3000/api/cron/video-uploads || echo "Scheduled video upload processing failed." >&2