-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
172 lines (163 loc) · 4.29 KB
/
docker-compose.prod.yml
File metadata and controls
172 lines (163 loc) · 4.29 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
version: '3.8'
services:
redis:
image: redis:7-alpine
container_name: synthoraai-redis-prod
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: >
redis-server
--appendonly yes
--appendfsync everysec
--maxmemory 4gb
--maxmemory-policy allkeys-lru
--requirepass ${REDIS_PASSWORD}
restart: always
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 10s
timeout: 3s
retries: 5
networks:
- synthoraai-network
mongodb:
image: mongo:6
container_name: synthoraai-mongodb-prod
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}
MONGO_INITDB_DATABASE: synthoraai
volumes:
- mongodb_data:/data/db
- mongodb_config:/data/configdb
- ./scripts/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
restart: always
command: mongod --auth --replSet rs0
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/synthoraai --quiet
interval: 10s
timeout: 5s
retries: 5
networks:
- synthoraai-network
stream-processor:
build:
context: .
dockerfile: Dockerfile
container_name: synthoraai-stream-processor-prod
ports:
- "8080:8080"
- "9090:9090"
environment:
- SERVICE_NAME=synthoraai-stream-processor
- SERVICE_PORT=8080
- LOG_LEVEL=info
- ENVIRONMENT=production
- MESSAGE_BROKER=redis
- REDIS_URL=redis://redis:6379
- REDIS_PASSWORD=${REDIS_PASSWORD}
- MONGODB_URI=mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@mongodb:27017
- MONGODB_DATABASE=synthoraai
- GOOGLE_AI_API_KEY=${GOOGLE_AI_API_KEY}
- WORKER_POOL_SIZE=30
- PROMETHEUS_ENABLED=true
- JAEGER_ENABLED=true
- JAEGER_ENDPOINT=http://jaeger:14268/api/traces
depends_on:
redis:
condition: service_healthy
mongodb:
condition: service_healthy
restart: always
deploy:
replicas: 3
resources:
limits:
cpus: '1'
memory: 1G
reservations:
cpus: '0.5'
memory: 512M
networks:
- synthoraai-network
prometheus:
image: prom/prometheus:latest
container_name: synthoraai-prometheus-prod
ports:
- "9091:9090"
volumes:
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./config/alerts.yml:/etc/prometheus/alerts.yml:ro
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=30d'
- '--web.enable-lifecycle'
- '--web.enable-admin-api'
restart: always
networks:
- synthoraai-network
grafana:
image: grafana/grafana:latest
container_name: synthoraai-grafana-prod
ports:
- "3001:3000"
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_USER}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
- GF_USERS_ALLOW_SIGN_UP=false
- GF_SERVER_ROOT_URL=https://monitoring.synthoraai.com
- GF_INSTALL_PLUGINS=redis-datasource
volumes:
- grafana_data:/var/lib/grafana
- ./config/grafana/provisioning:/etc/grafana/provisioning:ro
depends_on:
- prometheus
restart: always
networks:
- synthoraai-network
jaeger:
image: jaegertracing/all-in-one:latest
container_name: synthoraai-jaeger-prod
ports:
- "16686:16686"
- "14268:14268"
environment:
- SPAN_STORAGE_TYPE=elasticsearch
- ES_SERVER_URLS=http://elasticsearch:9200
restart: always
networks:
- synthoraai-network
nginx:
image: nginx:alpine
container_name: synthoraai-nginx-prod
ports:
- "80:80"
- "443:443"
volumes:
- ./config/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./config/nginx/ssl:/etc/nginx/ssl:ro
depends_on:
- stream-processor
restart: always
networks:
- synthoraai-network
networks:
synthoraai-network:
driver: bridge
volumes:
redis_data:
driver: local
mongodb_data:
driver: local
mongodb_config:
driver: local
prometheus_data:
driver: local
grafana_data:
driver: local