bottleneckcrm/docker-compose.yml
ashwin31 1f6b797909 feat: add Docker Compose setup for local development
Dockerize the full stack so developers can run everything with
`docker compose up`. Replaces the outdated Dockerfile and
docker-compose.yml with a working 6-service setup: PostgreSQL,
Redis, Django backend, Celery worker, Celery beat, and SvelteKit
frontend.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 10:01:50 +05:30

84 lines
1.7 KiB
YAML

services:
db:
image: postgres:16-alpine
env_file: .env.docker
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker/postgres/init-rls-user.sql:/docker-entrypoint-initdb.d/init-rls-user.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 3s
retries: 5
ports:
- "5432:5432"
redis:
image: redis:7-alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
ports:
- "6379:6379"
backend:
build:
context: .
dockerfile: Dockerfile
env_file: .env.docker
volumes:
- ./backend:/app
- ./docker/backend/entrypoint.sh:/entrypoint.sh:ro
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
command: /bin/bash /entrypoint.sh
celery-worker:
build:
context: .
dockerfile: Dockerfile
env_file: .env.docker
volumes:
- ./backend:/app
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
command: celery -A crm worker --loglevel=info
celery-beat:
build:
context: .
dockerfile: Dockerfile
env_file: .env.docker
volumes:
- ./backend:/app
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
command: celery -A crm beat --loglevel=info
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
env_file: .env.docker
volumes:
- ./frontend:/app
- frontend_node_modules:/app/node_modules
ports:
- "5173:5173"
volumes:
postgres_data:
frontend_node_modules: