-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
104 lines (99 loc) · 2.37 KB
/
docker-compose.yml
File metadata and controls
104 lines (99 loc) · 2.37 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
services:
# Node API Application - Production
api-prod:
profiles: ["production"]
build:
context: .
dockerfile: Dockerfile
target: production
container_name: node-api-skeleton
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- PORT=3000
- LOG_LEVEL=info
healthcheck:
test:
[
"CMD",
"node",
"-e",
"require('http').get('http://localhost:3000/health/live', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})",
]
interval: 30s
timeout: 3s
retries: 3
start_period: 10s
restart: unless-stopped
networks:
- app-network
depends_on:
- prometheus
# Node API Application - Development
api-dev:
profiles: ["dev"]
build:
context: .
dockerfile: Dockerfile
target: development
container_name: node-api-skeleton-dev
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- PORT=3000
- LOG_LEVEL=debug
volumes:
- ./src:/app/src:ro
- ./test:/app/test:ro
- /app/node_modules
restart: unless-stopped
networks:
- app-network
depends_on:
- prometheus
# Prometheus for metrics collection
prometheus:
image: prom/prometheus:latest
container_name: prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
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"
- "--web.enable-lifecycle"
restart: unless-stopped
networks:
- app-network
# Grafana for metrics visualization
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3001:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
- GF_SERVER_ROOT_URL=http://localhost:3001
volumes:
- grafana-data:/var/lib/grafana
restart: unless-stopped
networks:
- app-network
depends_on:
- prometheus
networks:
app-network:
driver: bridge
volumes:
prometheus-data:
driver: local
grafana-data:
driver: local