-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
206 lines (198 loc) · 5.23 KB
/
docker-compose.dev.yml
File metadata and controls
206 lines (198 loc) · 5.23 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
services:
nest_app:
container_name: nest_app_dev
build:
context: .
dockerfile: Dockerfile
target: development
env_file:
- .env.dev
environment:
- NODE_ENV=${NODE_ENV}
- NODE_PORT=${NODE_PORT}
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- DB_DATABASE=${DB_DATABASE}
- DB_USERNAME=${DB_USERNAME}
- DB_PASSWORD=${DB_PASSWORD}
- MONGODB_URI=${MONGODB_URI}
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_PORT}
- DYNAMODB_ENDPOINT=${DYNAMODB_ENDPOINT}
- AWS_REGION=${AWS_REGION}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
ports:
- "${NODE_PORT}:${NODE_PORT}"
command: npm run start:dev
volumes:
- .:/app
- /app/node_modules
depends_on:
- postgres
- redis
- dynamodb-local
# healthcheck:
# test: [ "CMD", "curl", "-f", "http://localhost:${NODE_PORT}/health" ]
# interval: 30s
# timeout: 10s
# retries: 3
# deploy:
# resources:
# limits:
# cpus: "0.5"
# memory: 1G
redis:
image: redis:latest
container_name: redis_dev
env_file:
- .env.dev
environment:
- REDIS_PORT=${REDIS_PORT}
ports:
- "${REDIS_PORT}:${REDIS_PORT}"
command: redis-server --maxmemory 200mb --maxmemory-policy allkeys-lru
# healthcheck:
# test: [ "CMD", "redis-cli", "ping" ]
# interval: 10s
# timeout: 5s
# retries: 5
# deploy:
# resources:
# limits:
# cpus: "0.2"
# memory: 250M
postgres:
image: postgres:13
container_name: postgres_dev
env_file:
- .env.dev
environment:
POSTGRES_DB: ${DB_DATABASE}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
ports:
- "${DB_PORT}:${DB_PORT}"
volumes:
- postgres_data_dev:/var/lib/postgresql/data
# healthcheck:
# test: [ "CMD-SHELL", "pg_isready -U ${DB_USERNAME}" ]
# interval: 10s
# timeout: 5s
# retries: 5
# deploy:
# resources:
# limits:
# cpus: "0.3"
# memory: 300M
dynamodb-local:
image: amazon/dynamodb-local:latest
container_name: dynamodb-local
env_file:
- .env.dev
ports:
- "${DYNAMODB_PORT}:${DYNAMODB_PORT}"
command: "-jar DynamoDBLocal.jar -sharedDb -port ${DYNAMODB_PORT}"
volumes:
- dynamodb_data:/home/dynamodblocal
# healthcheck:
# test: [ "CMD-SHELL", "curl -f http://localhost:${DYNAMODB_PORT} || exit 1" ]
# interval: 10s
# timeout: 5s
# retries: 5
# deploy:
# resources:
# limits:
# cpus: "0.2"
# memory: 300M
dynamodb-admin:
image: aaronshaf/dynamodb-admin
env_file:
- .env.dev
ports:
- "${DYNAMODB_ADMIN_PORT}:${DYNAMODB_ADMIN_PORT}"
environment:
DYNAMO_ENDPOINT: "${DYNAMODB_ENDPOINT}"
AWS_REGION: "${AWS_REGION}"
AWS_ACCESS_KEY_ID: "${AWS_ACCESS_KEY_ID}"
AWS_SECRET_ACCESS_KEY: "${AWS_SECRET_ACCESS_KEY}"
depends_on:
- dynamodb-local
prometheus:
image: prom/prometheus:v2.30.3
container_name: prometheus
env_file:
- .env.dev
environment:
- PROMETHEUS_PORT=${PROMETHEUS_PORT}
ports:
- "${PROMETHEUS_PORT}:${PROMETHEUS_PORT}"
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:
- ./prometheus:/etc/prometheus
- prometheus_data:/prometheus
# healthcheck:
# test: [ "CMD", "wget", "-q", "--tries=1", "--spider", "http://localhost:${PROMETHEUS_PORT}" ]
# interval: 30s
# timeout: 10s
# retries: 3
# deploy:
# resources:
# limits:
# cpus: "0.2"
# memory: 300M
node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
restart: unless-stopped
env_file:
- .env.dev
environment:
- NODE_EXPORTER_PORT=${NODE_EXPORTER_PORT}
ports:
- "${NODE_EXPORTER_PORT}:${NODE_EXPORTER_PORT}"
command:
- "--path.procfs=/host/proc"
- "--path.rootfs=/rootfs"
- "--path.sysfs=/host/sys"
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
- "--collector.loadavg"
- "--collector.meminfo"
- "--collector.cpu"
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
grafana:
image: grafana/grafana:8.2.2
container_name: grafana
env_file:
- .env.dev
environment:
- NODE_EXPORTER_PORT=${NODE_EXPORTER_PORT}
- NODE_PORT=${NODE_PORT}
ports:
- "${GRAFANA_PORT}:${NODE_PORT}"
volumes:
- grafana_data:/var/lib/grafana
depends_on:
- prometheus
# healthcheck:
# test: [ "CMD", "curl", "-f", "http://localhost:${GRAFANA_PORT}" ]
# interval: 30s
# timeout: 10s
# retries: 3
# deploy:
# resources:
# limits:
# cpus: "0.2"
# memory: 300M
volumes:
postgres_data_dev:
dynamodb_data:
prometheus_data:
grafana_data: