-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
93 lines (88 loc) · 2.26 KB
/
docker-compose.yml
File metadata and controls
93 lines (88 loc) · 2.26 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
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
services:
postgres:
image: postgres:18-alpine
container_name: fastapi-postgres-prod
ports:
- "5432:5432"
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- POSTGRES_DB=${POSTGRES_DB:-fastapi_ai_sdk}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 5s
timeout: 5s
retries: 5
restart: always
networks:
- app-network
backend:
build:
context: .
dockerfile: backend/Dockerfile
container_name: fastapi-backend
ports:
- "8000:8000"
environment:
- ENVIRONMENT=production
- OPENAI_API_KEY=${OPENAI_API_KEY}
- GEMINI_API_KEY=${GEMINI_API_KEY}
- CORS_ORIGINS=${CORS_ORIGINS:-http://localhost:3000}
- DATABASE_URL=${DATABASE_URL:-postgresql://postgres:postgres@postgres:5432/fastapi_ai_sdk}
depends_on:
postgres:
condition: service_healthy
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import http.client; c = http.client.HTTPConnection('localhost', 8000); c.request('GET', '/health'); r = c.getresponse(); exit(0 if r.status == 200 else 1)",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: always
networks:
- app-network
my_mcp:
build:
context: ./mcp
container_name: fastapi-my-mcp
ports:
- "8001:8000"
environment:
- WORKSPACE_ROOT=/workspace
volumes:
- .:/workspace
restart: always
networks:
- app-network
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: nextjs-frontend
# ports:
# - "3000:3000"
environment:
- NODE_ENV=production
- BASE_BACKEND_URL=http://backend:8000
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
- NEXTAUTH_URL=${NEXTAUTH_URL:-http://localhost:3000}
- NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL:-http://localhost:3000}
depends_on:
backend:
condition: service_healthy
restart: always
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
postgres_data: