docker-compose.prod.yml)| β¬ οΈ Back | π Docs Root |
This docker-compose.prod.yml file defines the multi-service Docker environment for deploying the Lily Website project in a production environment. It is optimized for production use, utilizing pre-built Docker images from a registry, gunicorn for the backend, and including services for SSL certificate management (Certbot) and Nginx.
The production docker-compose.prod.yml aims to:
restart: always policies.backend (FastAPI/Django)${DOCKER_IMAGE_BACKEND} (pulled from GHCR, e.g., ghcr.io/user/repo-backend:latest)lily_website-backendgunicorn to serve the Django/FastAPI application with 2 worker processes and a 90-second timeout..env (loaded from the deploy/ directory on the VPS).uploads: Persistent volume for user-uploaded media files.static_volume: Persistent volume for collected static files.logs_volume: Persistent volume for application logs.redis (waits for it to be healthy)./api/v1/health endpoint on the backend.always (restarts if it stops).lily_website-networkbot (Telegram Bot)${DOCKER_IMAGE_BOT} (pulled from GHCR)lily_website-telegram_bot.envlogs_volume: Persistent volume for application logs.always.redis and backend (waits for them to be healthy).lily_website-networkworker (ARQ Notification Worker)${DOCKER_IMAGE_WORKER} (pulled from GHCR)lily_website-worker_arqsrc.workers.notification_worker.worker.WorkerSettings..envlogs_volume: Persistent volume for application logs.always.redis (waits for it to be healthy).lily_website-networkredisredis:7-alpinelily_website-redis.envREDIS_PASSWORD) and AOF persistence enabled.redis-data: Persistent volume for Redis data.REDIS_PASSWORD.unless-stopped.lily_website-networknginx${DOCKER_IMAGE_NGINX} (pulled from GHCR)lily_website-nginx80 and 443 to container ports 80 and 443 respectively.DOMAIN_NAME for Nginx configuration../nginx/nginx-main.conf:/etc/nginx/nginx.conf:ro: Mounts the main Nginx configuration.uploads: Mounts user-uploaded media files (read-only).static_volume: Mounts collected static files (read-only).certs_volume: Mounts Letβs Encrypt certificates (read-only).certbot_challenge_volume: Mounts volume for Certbot ACME challenges (read-only).backend (waits for it to be healthy).always.lily_website-networkcertbotcertbot/certbotlily_website-certbotcerts_volume: Shared with Nginx for certificates.certbot_challenge_volume: Shared with Nginx for ACME challenges.lily_website-networkredis-data: For Redis persistent data.uploads: For user-uploaded media files (shared between backend and Nginx).static_volume: For collected static files (shared between backend and Nginx).logs_volume: For application logs (shared between backend, bot, and worker).certs_volume: For Letβs Encrypt SSL certificates (shared between Nginx and Certbot).certbot_challenge_volume: For Certbot ACME challenge files (shared between Nginx and Certbot).lily_website-network: A custom bridge network to allow all services to communicate with each other.