docker-compose.yml)| ⬅️ Back | 🏠Docs Root |
This docker-compose.yml file defines the multi-service Docker environment for local development of the Lily Website project. It sets up all necessary services, including databases, application containers, and development tools, allowing developers to run the entire application stack with a single command.
The development docker-compose.yml aims to:
db (PostgreSQL)postgres:16-alpinelily_website-dbpostgres_data: Persistent volume for database data.../scripts/init_db_schemas.sql: Mounts a script to initialize database schemas on container startup.POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD.lily_website-networkredisredis:7-alpinelily_website-redis../.env (loads environment variables from the project’s root .env file).REDIS_PASSWORD) and AOF persistence enabled.6380 to container port 6379.redis-data: Persistent volume for Redis data.REDIS_PASSWORD.lily_website-networkbackend (FastAPI/Django)deploy/backend/Dockerfile to build the image from the project root.lily_website-backend8000 to container port 8000.../.env../src/backend_django:/app: Mounts the backend source code for hot-reloading.uploads: Volume for user-uploaded media files.static_volume: Volume for collected static files.logs_volume: Volume for application logs.db and redis (waits for them to be healthy)./api/v1/health endpoint on the backend.lily_website-networkbot (Telegram Bot)deploy/bot/Dockerfile to build the image.lily_website-telegram_bot../.env../src/telegram_bot:/app/src/telegram_bot:ro: Mounts the bot’s source code (read-only).../src/shared:/app/src/shared:ro: Mounts shared code (read-only).redis and backend (waits for them to be healthy).lily_website-networkworker (ARQ Notification Worker)deploy/worker/Dockerfile to build the image.lily_website-notification_workersrc.workers.notification_worker.worker.WorkerSettings.../.env../src/workers:/app/src/workers:ro: Mounts the worker’s source code (read-only).../src/shared:/app/src/shared:ro: Mounts shared code (read-only).logs_volume: Volume for application logs.redis and backend (waits for them to be healthy).lily_website-networknginxdeploy/nginx/Dockerfile to build the image.lily_website-nginx8080 to container port 80.uploads: Mounts user-uploaded media files (read-only).static_volume: Mounts collected static files (read-only).backend (waits for it to be healthy).lily_website-networkmailpitaxllent/mailpit:latestlily_website-mailpit8025:8025: Web UI for Mailpit.1025:1025: SMTP server for Mailpit.lily_website-networkpostgres_data: For PostgreSQL persistent data.redis-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 and worker).lily_website-network: A custom bridge network to allow all services to communicate with each other.