-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
213 lines (201 loc) · 4.87 KB
/
docker-compose.yml
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
version: '3.8'
networks:
hamster-net:
driver: bridge
services:
hammy-postgres:
container_name: hammy-postgres
image: postgres:latest
restart: on-failure
env_file:
- .env
command:
- "postgres"
- "-c"
- "max_connections=100"
- "-c"
- "shared_buffers=100MB"
- "-c"
- "effective_cache_size=0.5GB"
- "-c"
- "work_mem=16MB"
- "-c"
- "maintenance_work_mem=64MB"
- "-c"
- "random_page_cost=1.1"
- "-c"
- "temp_file_limit=1GB"
- "-c"
- "log_min_duration_statement=200ms"
- "-c"
- "idle_in_transaction_session_timeout=10s"
- "-c"
- "lock_timeout=1s"
- "-c"
- "statement_timeout=60s"
- "-c"
- "shared_preload_libraries=pg_stat_statements"
- "-c"
- "pg_stat_statements.max=10000"
- "-c"
- "pg_stat_statements.track=all"
ports:
- "${DB_PORT}:5432"
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- ./build/schema/:/docker-entrypoint-initdb.d/
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
networks:
- hamster-net
hammy-redis:
container_name: hammy-redis
image: redis:latest
restart: on-failure
networks:
- hamster-net
ports:
- "${REDIS_PORT}:6379"
healthcheck:
test: [ "CMD-SHELL", "redis-cli ping" ]
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
auth:
container_name: ${AUTH_CONTAINER}
image: ${REGISTRY}/${AUTH_CONTAINER}:${GITHUB_SHA_SHORT}
#container_name: hammywallet-auth
#image: codemaster482/hammywallet-auth:latest
#build:
# context: .
# dockerfile: build/auth.Dockerfile
ports:
- "8010:8010"
- "8011:8011"
volumes:
- ./.env:/docker-hammywallet/.env
depends_on:
hammy-postgres:
condition: service_healthy
hammy-redis:
condition: service_healthy
networks:
- hamster-net
account:
container_name: ${ACCOUNT_CONTAINER}
image: ${REGISTRY}/${ACCOUNT_CONTAINER}:${GITHUB_SHA_SHORT}
#container_name: hammywallet-account
#image: codemaster482/hammywallet-account:latest
#build:
# context: .
# dockerfile: build/account.Dockerfile
ports:
- "8020:8020"
- "8021:8021"
volumes:
- ./.env:/docker-hammywallet/.env
networks:
- hamster-net
depends_on:
hammy-postgres:
condition: service_healthy
hammy-redis:
condition: service_healthy
category:
container_name: ${CATEGORY_CONTAINER}
image: ${REGISTRY}/${CATEGORY_CONTAINER}:${GITHUB_SHA_SHORT}
#container_name: hammywallet-category
#image: codemaster482/hammywallet-category:latest
#build:
# context: .
# dockerfile: build/category.Dockerfile
ports:
- "8030:8030"
- "8031:8031"
volumes:
- ./.env:/docker-hammywallet/.env
networks:
- hamster-net
depends_on:
hammy-postgres:
condition: service_healthy
hammy-redis:
condition: service_healthy
hammywallet-api:
container_name: ${CONTAINER_NAME}
image: ${REGISTRY}/${IMAGE_NAME}:${GITHUB_SHA_SHORT}
#container_name: hammywallet-api
#image: codemaster482/hammywallet:latest
env_file:
- .env
restart: always
ports:
- "8080:8080"
volumes:
- ./.env:/docker-hammywallet/.env
- ./api-logs:/docker-hammywallet/logs
- type: bind
source: /home/ubuntu/frontend/images
target: /images
depends_on:
hammy-postgres:
condition: service_healthy
hammy-redis:
condition: service_healthy
category:
condition: service_healthy
account:
condition: service_healthy
auth:
condition: service_healthy
networks:
- hamster-net
prometheus:
depends_on:
- hammywallet-api
container_name: prometheus
image: prom/prometheus:latest
volumes:
- ./metrics/prometheus/:/etc/prometheus/
ports:
- "8090:9090"
networks:
- hamster-net
nodeexporter:
container_name: node_exporter
image: prom/node-exporter
user: "0"
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
restart: unless-stopped
ports:
- "8100:9100"
networks:
- hamster-net
grafana:
container_name: grafana
image: grafana/grafana-oss:9.4.3
user: '0'
environment:
GF_SERVER_SERVE_FROM_SUB_PATH: "true"
GF_SERVER_ROOT_URL: "https://hammywallet.ru/grafana/"
ports:
- "8015:3000"
volumes:
- type: bind
source: /home/ubuntu/grafana_metrics
target: /var/lib/grafana
networks:
- hamster-net
volumes:
api-logs: