| version: "3.8" | |
| services: | |
| db: | |
| image: pgvector/pgvector:pg17 | |
| restart: unless-stopped | |
| environment: | |
| POSTGRES_USER: ${POSTGRES_USER:-jobportal} | |
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-jobportal} | |
| POSTGRES_DB: ${POSTGRES_DB:-jobportal} | |
| ports: | |
| - "5432:5432" | |
| volumes: | |
| - postgres_data:/var/lib/postgresql/data | |
| healthcheck: | |
| test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-jobportal}"] | |
| interval: 5s | |
| timeout: 5s | |
| retries: 5 | |
| redis: | |
| image: redis:7-alpine | |
| restart: unless-stopped | |
| ports: | |
| - "6379:6379" | |
| healthcheck: | |
| test: ["CMD", "redis-cli", "ping"] | |
| interval: 5s | |
| timeout: 5s | |
| retries: 5 | |
| backend: | |
| build: | |
| context: ./backend | |
| dockerfile: Dockerfile | |
| restart: unless-stopped | |
| env_file: | |
| - .env | |
| environment: | |
| - POSTGRES_SERVER=db | |
| - REDIS_URL=redis://redis:6379/0 | |
| ports: | |
| - "8000:8000" | |
| depends_on: | |
| db: | |
| condition: service_healthy | |
| redis: | |
| condition: service_healthy | |
| volumes: | |
| - ./backend:/app | |
| command: uv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload | |
| worker: | |
| build: | |
| context: ./backend | |
| dockerfile: Dockerfile | |
| restart: unless-stopped | |
| env_file: | |
| - .env | |
| environment: | |
| - POSTGRES_SERVER=db | |
| - REDIS_URL=redis://redis:6379/0 | |
| depends_on: | |
| db: | |
| condition: service_healthy | |
| redis: | |
| condition: service_healthy | |
| volumes: | |
| - ./backend:/app | |
| command: uv run celery -A app.worker.celery_config.celery_app worker --loglevel=info --concurrency=4 | |
| beat: | |
| build: | |
| context: ./backend | |
| dockerfile: Dockerfile | |
| restart: unless-stopped | |
| env_file: | |
| - .env | |
| environment: | |
| - POSTGRES_SERVER=db | |
| - REDIS_URL=redis://redis:6379/0 | |
| depends_on: | |
| db: | |
| condition: service_healthy | |
| redis: | |
| condition: service_healthy | |
| volumes: | |
| - ./backend:/app | |
| command: uv run celery -A app.worker.celery_config.celery_app beat --loglevel=info | |
| volumes: | |
| postgres_data: | |