-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
65 lines (60 loc) · 1.35 KB
/
docker-compose.yml
File metadata and controls
65 lines (60 loc) · 1.35 KB
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
services:
# Database
db:
image: postgres:15-alpine
restart: always
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- POSTGRES_DB=${POSTGRES_DB:-ai_debates}
# In production, we don't expose DB port to public
# ports:
# - "5432:5432"
# Redis (Queue + PubSub)
redis:
image: redis:7-alpine
restart: always
# In production, we don't expose Redis port to public
# ports:
# - "6379:6379"
# Backend API
api:
build: ./backend
restart: always
# Production command with proxy headers
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --proxy-headers --forwarded-allow-ips='*'
env_file:
- .env
depends_on:
- db
- redis
# Worker (RQ)
worker:
build: ./backend
restart: always
command: python -m app.worker
env_file:
- .env
depends_on:
- db
- redis
# Frontend + Caddy Proxy
frontend:
container_name: ai-debates-frontend-1
build:
context: ./frontend
dockerfile: Dockerfile
args:
- VITE_API_URL=/api
restart: always
ports:
- "80:80"
environment:
- DOMAIN_NAME=:80
- VITE_API_URL=/api
depends_on:
- api
volumes:
postgres_data: