-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
263 lines (248 loc) · 7.32 KB
/
docker-compose.yml
File metadata and controls
263 lines (248 loc) · 7.32 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
version: '3.8'
# ============================================
# NETWORKS
# ============================================
networks:
entrepreneur-network:
driver: bridge
# ============================================
# VOLUMES
# ============================================
volumes:
postgres-master-data:
postgres-ecommerce-data:
redis-data:
opensearch-data:
opensearch-dashboards-data:
n8n-data:
grafana-data:
prometheus-data:
uptime-kuma-data:
# ============================================
# SERVICES
# ============================================
services:
# ==========================================
# DATABASES
# ==========================================
# PostgreSQL - Vendure Master
postgres-master:
image: postgres:16-alpine
container_name: entrepreneur-postgres-master
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_MASTER_DB}
POSTGRES_USER: ${POSTGRES_MASTER_USER}
POSTGRES_PASSWORD: ${POSTGRES_MASTER_PASSWORD}
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- postgres-master-data:/var/lib/postgresql/data
ports:
- "${POSTGRES_MASTER_PORT}:5432"
networks:
- entrepreneur-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_MASTER_USER} -d ${POSTGRES_MASTER_DB}"]
interval: 10s
timeout: 5s
retries: 5
# PostgreSQL - Vendure Ecommerce
postgres-ecommerce:
image: postgres:16-alpine
container_name: entrepreneur-postgres-ecommerce
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_ECOMMERCE_DB}
POSTGRES_USER: ${POSTGRES_ECOMMERCE_USER}
POSTGRES_PASSWORD: ${POSTGRES_ECOMMERCE_PASSWORD}
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- postgres-ecommerce-data:/var/lib/postgresql/data
ports:
- "5433:5432"
networks:
- entrepreneur-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_ECOMMERCE_USER} -d ${POSTGRES_ECOMMERCE_DB}"]
interval: 10s
timeout: 5s
retries: 5
# Redis
redis:
image: redis:7-alpine
container_name: entrepreneur-redis
restart: unless-stopped
command: redis-server --requirepass ${REDIS_PASSWORD}
volumes:
- redis-data:/data
ports:
- "${REDIS_PORT}:6379"
networks:
- entrepreneur-network
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 10s
timeout: 5s
retries: 5
# ==========================================
# MONITORING & LOGGING
# ==========================================
# OpenSearch
opensearch:
image: opensearchproject/opensearch:2.11.1
container_name: entrepreneur-opensearch
restart: unless-stopped
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true
- "OPENSEARCH_JAVA_OPTS=${OPENSEARCH_JAVA_OPTS}"
- DISABLE_SECURITY_PLUGIN=true
- DISABLE_INSTALL_DEMO_CONFIG=true
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- opensearch-data:/usr/share/opensearch/data
ports:
- "${OPENSEARCH_PORT}:9200"
- "9600:9600"
networks:
- entrepreneur-network
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:9200/_cluster/health || exit 1"]
interval: 30s
timeout: 10s
retries: 5
# OpenSearch Dashboards
opensearch-dashboards:
image: opensearchproject/opensearch-dashboards:2.11.1
container_name: entrepreneur-opensearch-dashboards
restart: unless-stopped
environment:
OPENSEARCH_HOSTS: '["http://opensearch:9200"]'
DISABLE_SECURITY_DASHBOARDS_PLUGIN: "true"
ports:
- "${OPENSEARCH_DASHBOARD_PORT}:5601"
networks:
- entrepreneur-network
depends_on:
opensearch:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:5601/api/status || exit 1"]
interval: 30s
timeout: 10s
retries: 5
# Prometheus
prometheus:
image: prom/prometheus:latest
container_name: entrepreneur-prometheus
restart: unless-stopped
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
volumes:
- ./infrastructure/monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus-data:/prometheus
ports:
- "${PROMETHEUS_PORT}:9090"
networks:
- entrepreneur-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9090/-/healthy"]
interval: 30s
timeout: 10s
retries: 3
# Grafana
grafana:
image: grafana/grafana:latest
container_name: entrepreneur-grafana
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
- GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource
volumes:
- grafana-data:/var/lib/grafana
- ./infrastructure/monitoring/grafana/provisioning:/etc/grafana/provisioning
- ./infrastructure/monitoring/grafana/dashboards:/var/lib/grafana/dashboards
ports:
- "${GRAFANA_PORT}:3000"
networks:
- entrepreneur-network
depends_on:
- prometheus
- opensearch
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3000/api/health || exit 1"]
interval: 30s
timeout: 10s
retries: 5
# Uptime Kuma (Monitoring de uptime)
uptime-kuma:
image: louislam/uptime-kuma:1
container_name: entrepreneur-uptime-kuma
restart: unless-stopped
volumes:
- uptime-kuma-data:/app/data
ports:
- "${UPTIME_KUMA_PORT}:3001"
networks:
- entrepreneur-network
# ==========================================
# AUTOMATION
# ==========================================
# n8n
n8n:
image: n8nio/n8n:latest
container_name: entrepreneur-n8n
restart: unless-stopped
environment:
- N8N_BASIC_AUTH_ACTIVE=${N8N_BASIC_AUTH_ACTIVE}
- N8N_BASIC_AUTH_USER=${N8N_BASIC_AUTH_USER}
- N8N_BASIC_AUTH_PASSWORD=${N8N_BASIC_AUTH_PASSWORD}
- N8N_HOST=0.0.0.0
- N8N_PORT=5678
- N8N_PROTOCOL=http
- NODE_ENV=production
- WEBHOOK_URL=http://localhost:5678/
- GENERIC_TIMEZONE=${TZ}
volumes:
- n8n-data:/home/node/.n8n
- ./apps/n8n-workflows:/home/node/workflows
ports:
- "${N8N_PORT}:5678"
networks:
- entrepreneur-network
depends_on:
postgres-master:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:5678/healthz || exit 1"]
interval: 30s
timeout: 10s
retries: 5
# ==========================================
# ADMINER (Database Management UI)
# ==========================================
adminer:
image: adminer:latest
container_name: entrepreneur-adminer
restart: unless-stopped
ports:
- "8080:8080"
networks:
- entrepreneur-network
depends_on:
- postgres-master
- postgres-ecommerce
environment:
ADMINER_DEFAULT_SERVER: postgres-master