-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
251 lines (237 loc) · 6.02 KB
/
docker-compose.yml
File metadata and controls
251 lines (237 loc) · 6.02 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
version: '3.8'
services:
admin:
build:
dockerfile: Dockerfile.admin
container_name: osadm
working_dir: /home
volumes:
- ./../../:/home
- ${VOLUME_DIR}:/home/volume
- ${CONFIG_DIR}:/home/config
networks:
- client
- oracle
- validator
stdin_open: true
api-client:
build:
dockerfile: Dockerfile.service
container_name: osa
command: ["/bin/bash", "-c", "./bin/$${NODE_VERSION}/api-client"]
working_dir: "/app"
stop_grace_period: 2m
expose:
- "8080"
volumes:
- ${VOLUME_DIR}/api-client/:/app
env_file:
- ${CONFIG_DIR}/api-client/.env
environment:
- RUST_LOG=${RUST_LOG:-info}
- AXUM_HTTP_REQUESTS_TOTAL="api_client_requests"
- AXUM_HTTP_REQUESTS_DURATION_SECONDS="api_client_request_duration"
- AXUM_HTTP_REQUESTS_PENDING="api_client_requests_pending"
restart: unless-stopped
networks:
- client
stdin_open: true
tty: true
daemon-client:
build:
dockerfile: Dockerfile.service
container_name: osd
command: ["/bin/bash", "-c", "./bin/$${NODE_VERSION}/daemon-client"]
working_dir: "/app"
stop_grace_period: 2m
volumes:
- ${VOLUME_DIR}/daemon-client/:/app
env_file:
- ${CONFIG_DIR}/daemon-client/.env
environment:
- RUST_LOG=${RUST_LOG:-info}
# restart: unless-stopped
networks:
- client
stdin_open: true
tty: true
oracle:
build:
dockerfile: Dockerfile.service
container_name: oso
command: ["/bin/bash", "-c", "./bin/$${NODE_VERSION}/oracle"]
working_dir: "/app"
stop_grace_period: 5m
volumes:
- ${VOLUME_DIR}/oracle/:/app
env_file:
- ${CONFIG_DIR}/oracle/.env
environment:
- RUST_LOG=${RUST_LOG:-info}
# restart: unless-stopped
networks:
- oracle
stdin_open: true
tty: true
validator:
build:
dockerfile: Dockerfile.service
container_name: osv
command: ["/bin/bash", "-c", "./bin/$${NODE_VERSION}/validator"]
working_dir: "/app"
stop_grace_period: 5m
volumes:
- ${VOLUME_DIR}/validator/:/app
env_file:
- ${CONFIG_DIR}/validator/.env
environment:
- RUST_LOG=${RUST_LOG:-info}
# restart: unless-stopped
networks:
- validator
stdin_open: true
tty: true
postgres:
image: postgres:17
container_name: osp
stop_grace_period: 1m
env_file:
- ${CONFIG_DIR}/postgres/.env
ports:
- "5432:5432"
volumes:
- ${VOLUME_DIR}/postgres:/var/lib/postgresql/data
networks:
- client
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
redis:
image: redis:7-alpine
container_name: osr
stop_grace_period: 30s
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
ports:
- "6379:6379"
volumes:
- ${VOLUME_DIR}/redis:/redis
- ${CONFIG_DIR}/redis/redis.conf:/usr/local/etc/redis/redis.conf:ro
networks:
- client
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
nginx:
image: nginx:mainline-alpine3.22
container_name: osn
ports:
- "80:80"
- "443:443"
volumes:
- ${CONFIG_DIR}/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ${CONFIG_DIR}/nginx:/etc/nginx/templates:ro
- ${VOLUME_DIR}/certbot/conf:/etc/letsencrypt:ro
- ${VOLUME_DIR}/certbot/www:/var/www/certbot:ro
- ${VOLUME_DIR}/nginx/log:/var/log/nginx
env_file:
- ${CONFIG_DIR}/nginx/.env
environment:
- NGINX_ENVSUBST_TEMPLATE_SUFFIX=.template
- NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx/conf.d
networks:
- client
restart: unless-stopped
healthcheck:
test: ["CMD", "nginx", "-t"]
interval: 60s
timeout: 30s
retries: 3
start_period: 30s
certbot:
image: certbot/certbot:v5.0.0
container_name: osc
env_file:
- ${CONFIG_DIR}/nginx/.env
volumes:
- ${VOLUME_DIR}/certbot/conf:/etc/letsencrypt
- ${VOLUME_DIR}/certbot/www:/var/www/certbot
command: >
sh -c 'certonly --webroot --webroot-path=/var/www/certbot --email $$CERTBOT_EMAIL --agree-tos --no-eff-email -d $$DOMAIN_NAME'
depends_on:
nginx:
condition: service_healthy
profiles:
- certbot
postgres-exporter:
image: quay.io/prometheuscommunity/postgres-exporter:v0.17.1
container_name: ospexp
restart: unless-stopped
env_file:
- ${CONFIG_DIR}/postgres/.env
# environment:
# - DATA_SOURCE_NAME=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DB}?sslmode=disable
depends_on:
postgres:
condition: service_healthy
networks:
- monitoring
- client
node-exporter:
image: quay.io/prometheus/node-exporter:v1.9.1
container_name: osnexp
command:
- '--path.rootfs=/host'
ports:
- "9100:9100"
networks:
- monitoring
restart: unless-stopped
volumes:
- '/:/host:ro'
cadvisor:
image: gcr.io/cadvisor/cadvisor:v0.52.0
container_name: cadvisor
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
restart: unless-stopped
networks:
- monitoring
- client
- oracle
- validator
grafana-agent:
image: grafana/agent:v0.44.2
container_name: grafana-agent
env_file:
- ${CONFIG_DIR}/grafana/.env
volumes:
- ${CONFIG_DIR}/grafana/agent.yaml:/etc/agent/agent.yaml
command:
- '-config.file=/etc/agent/agent.yaml'
- '-config.expand-env=true'
restart: unless-stopped
# extra_hosts:
# - "host.docker.internal:host-gateway"
networks:
- monitoring
- client
networks:
client:
driver: bridge
oracle:
driver: bridge
validator:
driver: bridge
monitoring:
driver: bridge