forked from pantos-io/validatornode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
225 lines (220 loc) · 6.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
214
215
216
217
218
219
220
221
222
223
224
225
networks:
pantos-validator-node:
name: pantos-validator-node-${STACK_IDENTIFIER}-${INSTANCE-1}
driver: overlay
internal: true
attachable: true
pantos-validator-node-primary:
name: pantos-validator-node-${STACK_IDENTIFIER}-primary
driver: overlay
attachable: true
services:
app:
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
image: ${DOCKER_REGISTRY-pantosio}/validator-node-app:${DOCKER_TAG-local}
build:
context: .
dockerfile: Dockerfile
target: validatornode01
x-bake:
tags:
- ${DOCKER_REGISTRY-pantosio}/validator-node-app:${DOCKER_TAG-local}
- ${DOCKER_REGISTRY-pantosio}/validator-node-app:${EXTRA_TAG-local}
networks:
pantos-validator-node:
pantos-validator-node-primary:
aliases:
- pantos-validator-node-${INSTANCE-1}
env_file: []
environment:
# Ignore the env file inside the docker container
PANTOS_ENV_FILE: ' '
APP_HOST: 0.0.0.0
APP_PORT: 8080
APP_MODE: ${APP_MODE-primary}
APP_LOG_FILE_ENABLED: 'false'
APP_LOG_FORMAT: human_readable
DB_URL: postgresql+psycopg://pantos-validator-node:pantos@db/pantos-validator-node
CELERY_BROKER: amqp://pantos-validator-node:pantos@broker:5672/pantos-validator-node
CELERY_BACKEND: db+postgresql+psycopg://pantos-validator-node:pantos@db/pantos-validator-node-celery
DEV_MODE: ${DEV_MODE}
ports:
- 809${INSTANCE-0}:8080
healthcheck:
test: ["CMD", "/usr/bin/pantos-validator-node-server", "--status"]
interval: 5s
timeout: 10s
retries: 3
start_period: 10s
depends_on:
broker:
condition: service_healthy
db:
condition: service_healthy
develop:
watch:
- action: sync
path: ./pantos
target: /opt/pantos/pantos-service-node/lib/python3.12/site-packages/pantos
- action: sync+restart
path: ./linux/scripts/start-web.py
target: /opt/pantos/pantos-validator-node/bin/start-web.py
- action: sync+restart
path: ./linux/scripts/pantos-validator-node-server
target: /opt/pantos/pantos-validator-node/bin/pantos-validator-node-server
- action: sync+restart
path: validator-node-config.yml
target: /opt/pantos/pantos-validator-node/validator-node-config.yml
- action: sync+restart
path: alembic.ini
target: /opt/pantos/pantos-validator-node/alembic.ini
- action: sync+restart
path: validator-node-config.env
target: /root/validator-node-config.env
- action: sync+restart
path: bids.yml
target: /etc/validator-node-bids.yml
- action: rebuild
path: Dockerfile
- action: rebuild
path: debian
- action: rebuild
path: configurator
- action: rebuild
path: linux/etc
- action: rebuild
path: pyproject.toml
- action: rebuild
path: poetry.lock
worker:
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
image: ${DOCKER_REGISTRY-pantosio}/validator-node-worker:${DOCKER_TAG-local}
build:
context: .
dockerfile: Dockerfile
target: validatornode01-celery-worker
x-bake:
tags:
- ${DOCKER_REGISTRY-pantosio}/validator-node-worker:${DOCKER_TAG-local}
- ${DOCKER_REGISTRY-pantosio}/validator-node-worker:${EXTRA_TAG-local}
networks:
pantos-validator-node:
env_file: []
environment:
# Ignore the env file inside the docker container
PANTOS_ENV_FILE: ' '
PANTOS_CELERY_AUTORESTART: 'true'
APP_HOST: 0.0.0.0
APP_PORT: 8080
APP_MODE: ${APP_MODE-primary}
CELERY_LOG_FORMAT: human_readable
CELERY_LOG_FILE_ENABLED: 'false'
DB_URL: postgresql+psycopg://pantos-validator-node:pantos@db/pantos-validator-node
CELERY_BROKER: amqp://pantos-validator-node:pantos@broker:5672/pantos-validator-node
CELERY_BACKEND: db+postgresql+psycopg://pantos-validator-node:pantos@db/pantos-validator-node-celery
DEV_MODE: ${DEV_MODE}
healthcheck:
test: ["CMD", "/usr/bin/pantos-validator-node-celery", "--status"]
interval: 5s
timeout: 10s
retries: 3
start_period: 20s
depends_on:
app:
condition: service_healthy
develop:
watch:
- action: sync
path: ./pantos
target: /opt/pantos/pantos-validator-node/lib/python3.12/site-packages/pantos
- action: sync+restart
path: ./linux/scripts/pantos-validator-node-celery
target: /opt/pantos/pantos-validator-node/bin/pantos-validator-node-celery
- action: sync+restart
path: validator-node-config.yml
target: /opt/pantos/pantos-validator-node/validator-node-config.yml
- action: sync+restart
path: alembic.ini
target: /opt/pantos/pantos-validator-node/alembic.ini
- action: sync+restart
path: validator-node-config.env
target: /root/validator-node-config.env
- action: sync+restart
path: bids.yml
target: /etc/validator-node-bids.yml
- action: rebuild
path: Dockerfile
- action: rebuild
path: debian
- action: rebuild
path: configurator
- action: rebuild
path: linux/etc
- action: rebuild
path: pyproject.toml
- action: rebuild
path: poetry.lock
db:
image: postgres:latest
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
healthcheck:
test: [ "CMD", "pg_isready", "-U", "postgres" ]
interval: 10s
timeout: 5s
retries: 5
networks:
pantos-validator-node:
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
volumes:
- postgresql_data:/postgresql_data
- type: bind
source: ./db_init.sh
target: /docker-entrypoint-initdb.d/init-user-db.sh
read_only: true
develop:
watch:
- action: rebuild
path: db_init.sh
broker:
image: rabbitmq:latest
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
hostname: pantos-validator-node
networks:
pantos-validator-node:
healthcheck:
test: [ "CMD", "rabbitmqctl", "status" ]
interval: 10s
timeout: 5s
retries: 5
environment:
RABBITMQ_DEFAULT_USER: pantos-validator-node
RABBITMQ_DEFAULT_PASS: pantos
RABBITMQ_DEFAULT_VHOST: pantos-validator-node
volumes:
- rabbitmq_data:/rabbitmq_data
volumes:
postgresql_data:
rabbitmq_data: