-
-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
153 lines (146 loc) · 3.68 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
153 lines (146 loc) · 3.68 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
services:
# Neo4j Database
neo4j:
image: neo4j:latest
container_name: pwnflow-neo4j-prod
# Remove external ports - only accessible within network
volumes:
- $PWD/neo4j-data-prod:/data
environment:
- NEO4J_AUTH=${NEO4J_AUTH:-neo4j/password}
- NEO4J_PLUGINS=["apoc"]
- NEO4J_dbms_security_procedures_unrestricted=apoc.*
restart: unless-stopped
networks:
- pwnflow-prod-network
healthcheck:
test:
[
"CMD-SHELL",
"wget --no-verbose --tries=1 --spider http://localhost:7474 || exit 1",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# Redis Cache
redis:
image: redis:7-alpine
container_name: pwnflow-redis-prod
volumes:
- redis-data-prod:/data
restart: unless-stopped
command: redis-server --appendonly yes
networks:
- pwnflow-prod-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
start_period: 10s
# Backend API
backend:
build:
context: .
dockerfile: backend/Dockerfile.prod
container_name: pwnflow-backend-prod
env_file:
- ./.env.production
environment:
- NEO4J_URI=bolt://neo4j:7687
- NEO4J_USER=neo4j
- REDIS_URL=redis://redis:6379
- AI_SERVICE_URL=http://ai-service:8001
- PYTHONUNBUFFERED=1
- PYTHONPATH=/app
depends_on:
neo4j:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
networks:
- pwnflow-prod-network
healthcheck:
test:
["CMD-SHELL", "curl -f http://localhost:8000/api/v1/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
# AI Microservice API
ai-service:
build:
context: .
dockerfile: services/ai-service/Dockerfile
container_name: pwnflow-ai-service-prod
expose:
- "8001"
environment:
- REDIS_URL=redis://redis:6379
- GOOGLE_API_KEY=${GOOGLE_API_KEY}
- SERVICE_VERSION=${APP_VERSION:-1.0.0}
depends_on:
redis:
condition: service_healthy
restart: unless-stopped
networks:
- pwnflow-prod-network
# AI Celery Worker
ai-worker:
build:
context: .
dockerfile: services/ai-service/Dockerfile
container_name: pwnflow-ai-worker-prod
environment:
- REDIS_URL=redis://redis:6379
- GOOGLE_API_KEY=${GOOGLE_API_KEY}
depends_on:
redis:
condition: service_healthy
ai-service:
condition: service_started
restart: unless-stopped
networks:
- pwnflow-prod-network
command: celery -A celery_app worker --loglevel=warning --concurrency=2
# Nginx with Frontend
nginx:
build:
context: .
dockerfile: Dockerfile.nginx
args:
- VITE_API_BASE_URL=${FRONTEND_API_URL:-/api/v1}
- VITE_APP_ENV=${APP_ENV:-production}
- VITE_ENABLE_ANALYTICS=${ENABLE_ANALYTICS:-true}
container_name: pwnflow-nginx-prod
ports:
- "80:80"
- "443:443" # For HTTPS in production
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
networks:
- pwnflow-prod-network
volumes:
# For Let's Encrypt certificates
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
healthcheck:
test:
[
"CMD-SHELL",
"wget --no-verbose --tries=1 --spider http://localhost/ || exit 1",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
pwnflow-prod-network:
driver: bridge
volumes:
neo4j-data-prod:
redis-data-prod: