File size: 2,766 Bytes
d00203b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# VoiceForge Development Docker Compose
# Runs all services locally for development

version: '3.8'

services:
  # PostgreSQL Database
  db:
    image: postgres:15-alpine
    container_name: voiceforge-db
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: voiceforge
    volumes:
      - postgres_data:/var/lib/postgresql/data
    ports:
      - "5432:5432"
    healthcheck:
      test: [ "CMD-SHELL", "pg_isready -U postgres" ]
      interval: 10s
      timeout: 5s
      retries: 5

  # Redis Cache
  redis:
    image: redis:7-alpine
    container_name: voiceforge-redis
    ports:
      - "6379:6379"
    volumes:
      - redis_data:/data
    healthcheck:
      test: [ "CMD", "redis-cli", "ping" ]
      interval: 10s
      timeout: 5s
      retries: 5

  # FastAPI Backend
  backend:
    build:
      context: ../../backend
      dockerfile: ../deploy/docker/Dockerfile.backend
    container_name: voiceforge-backend
    environment:
      - DATABASE_URL=postgresql://postgres:postgres@db:5432/voiceforge
      - REDIS_URL=redis://redis:6379/0
      - GOOGLE_APPLICATION_CREDENTIALS=/app/credentials/google-cloud-key.json
      - DEBUG=true
      - API_HOST=0.0.0.0
      - API_PORT=8000
    volumes:
      - ../../backend/app:/app/app # Hot reload
      - ../../credentials:/app/credentials:ro # Google Cloud credentials
      - uploads_data:/app/uploads
    ports:
      - "8000:8000"
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_healthy
    command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload

  # Celery Worker (for async tasks)
  worker:
    build:
      context: ../../backend
      dockerfile: ../deploy/docker/Dockerfile.backend
    container_name: voiceforge-worker
    environment:
      - DATABASE_URL=postgresql://postgres:postgres@db:5432/voiceforge
      - REDIS_URL=redis://redis:6379/0
      - GOOGLE_APPLICATION_CREDENTIALS=/app/credentials/google-cloud-key.json
    volumes:
      - ../../backend/app:/app/app
      - ../../credentials:/app/credentials:ro
      - uploads_data:/app/uploads
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_healthy
    command: celery -A app.workers.celery_app worker --loglevel=info

  # Streamlit Frontend
  frontend:
    build:
      context: ../../frontend
      dockerfile: ../deploy/docker/Dockerfile.frontend
    container_name: voiceforge-frontend
    environment:
      - API_BASE_URL=http://backend:8000
    volumes:
      - ../../frontend:/app # Hot reload
    ports:
      - "8501:8501"
    depends_on:
      - backend

volumes:
  postgres_data:
  redis_data:
  uploads_data:


networks:
  default:
    name: voiceforge-network