forked from Luivatra/ergopad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-dev.yml
289 lines (269 loc) · 8.21 KB
/
docker-compose-dev.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
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
version: '3.9'
# docker compose --env-file .env.development.local -f docker-compose-{env}.yml --profile {profile} up -d {service(s)}
# docker compose --env-file .env.development.local -f docker-compose-dev.yml up -d
# -d = daemon mode
# tail /dev/null -f
services:
nginx:
container_name: nginx
env_file: .env.development.local
image: nginx:1.21
volumes:
- ./nginx:/etc/nginx
ports:
- ${NGINX_PORT}:${NGINX_PORT}
backend:
container_name: backend
env_file: .env.development.local
build:
context: .
dockerfile: Dockerfile.backend
volumes:
- ./backend/app:/app
ports:
- ${BACKEND_PORT}:${BACKEND_PORT}
depends_on:
- postgres
command: uvicorn main:app --reload --workers 2 --reload-dir /app --host 0.0.0.0 --port ${BACKEND_PORT}
frontend:
container_name: frontend
env_file: .env.development.local
build:
context: .
dockerfile: Dockerfile.frontend
volumes:
- ./frontend:/app
ports:
- ${FRONTEND_PORT}:${FRONTEND_PORT}
profiles:
- dev
- frontend
command: yarn dev
postgres:
container_name: postgres
env_file: .env.development.local
image: postgres:14
restart: always
volumes:
- postgres_data_dev:/var/lib/postgresql/data:cached
ports:
- ${POSTGRES_PORT}:${POSTGRES_PORT}
redis:
container_name: redis
env_file: .env.development.local
image: redis
volumes:
- redis_data_dev:/data # redis persistence
ports:
- ${REDIS_PORT}:${REDIS_PORT}
entrypoint: redis-server --appendonly yes
pgadmin:
container_name: pgadmin
env_file: .env.development.local
image: dpage/pgadmin4
ports:
- ${PGADMIN_LISTEN_PORT}:80
profiles:
- dev
- monitor
depends_on:
- postgres
profiles:
- dev
- monitor
pgmaint:
container_name: pgmaint
image: postgres:alpine
env_file: .env.production.local
working_dir: /app
environment:
- BASEDIR=/backups
- DBLIST=ergopad alpha hello
- DUMPPREFIX=ergopad
volumes:
- /backups/pgmaint:/backups
- ./pgmaint/periodic/daily:/etc/periodic/daily/:ro
- ./app:/app
# command: start.sh
profiles:
- dev
- backup
command: tail /dev/null -f
aggregator:
container_name: aggregator
env_file: .env.development.local
build:
context: .
dockerfile: Dockerfile.aggregator
volumes:
- ./aggregator/app:/app # !! update for main docker-compose file
ports:
- ${AGGREGATOR_PORT}:${AGGREGATOR_PORT}
# command: uvicorn main:app --reload --workers 4 --reload-dir /app --host 0.0.0.0 --port ${AGGREGATOR_PORT}
command: python main.py # TODO: automate with celery and API to call refreshes; infinite loop for now
celery:
container_name: celery
env_file: .env.development.local
build:
context: .
dockerfile: Dockerfile.celery
environment:
- CELERY_QUEUE
volumes:
- ./celery/app:/app # !! update for main docker-compose file
# command: celery --app main.celery worker --loglevel=${CELERY_LOGLEVEL} -Q ${CELERY_QUEUE} -c 1
command: tail /dev/null -f
flower:
container_name: flower
env_file: .env.development.local
image: mher/flower
ports:
- ${FLOWER_PORT}:${FLOWER_PORT}
depends_on:
- redis
- celery
profiles:
- dev
- monitor
command: celery --broker=redis://redis:${REDIS_PORT}/0 flower --port=${FLOWER_PORT}
# working really well 1/17/2022
# - ?? will 3G be enough for mainnet
# - alpine doesn't seem to work
# - permission issues with ergoplatform pre-built (plus potentially additional unused image bytes)
ergonode:
container_name: ergonode
env_file: .env.development.local
image: openjdk # :alpine
volumes:
- ergonode_data:/opt/ergo/.ergo # blockchain data
- ./ergonode/testnet.conf:${ERGONODE_CONF} # conf file
- ./ergonode/ergo-4.0.20.2.jar:/opt/ergo/ergo.jar # jar executable
ports:
- ${ERGONODE_PORT}:${ERGONODE_PORT}
- 9030:9030
working_dir: /opt/ergo
deploy:
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 5
window: 90s
logging:
driver: "json-file"
options:
max-file: 5
max-size: 10m
command: java -jar -Xmx3G -Dlogback.stdout.level=${ERGONODE_LOGLEVEL} -Dlogback.file.level=${ERGONODE_LOGLEVEL} ergo.jar --${ERGONODE_NETWORK} -c ${ERGONODE_CONF}
# only in dev.yml
ergonode2:
container_name: ergonode2
env_file: .env.development.local
image: openjdk # openjdk:alpine # ?? latest
volumes:
- ./ergonode/ergonode2:/opt/ergo # jar/conf
- /ergo/testnet2/.ergo:/ergo/.ergo # blockchain
ports:
- ${ERGONODE2_PORT}:${ERGONODE_PORT}
working_dir: /opt/ergo
healthcheck:
test: python healthcheck.py -p ${ERGONODE_PORT}
interval: 5m # > block time; look for change in height
timeout: 30s
# retries: 5
start_period: 30s
logging:
driver: "json-file"
options:
max-file: 5
max-size: 10m
profiles:
- dev
command: java -jar -Xmx3G -Dlogback.stdout.level=${ERGONODE_LOGLEVEL} -Dlogback.file.level=${ERGONODE_LOGLEVEL} ergo.jar --${ERGONODE_NETWORK} -c ${ERGONODE2_CONF}
# only in dev.yml
ergonode3:
container_name: ergonode3
env_file: .env.development.local
image: ergoplatform/ergo
volumes:
# - ./ergonode/ergonode2:/opt/ergo # jar/conf
- /ergo/testnet3/.ergo:/home/ergo/.ergo # blockchain
- ./ergonode/myergo.conf:/etc/myergo.conf
ports:
- 9054:9052
environment:
- MAX_HEAP=3G
deploy:
restart_policy:
condition: any # One of none, on-failure or any (default: any).
delay: 2s
# max_attempts: 3
window: 30s # How long to wait before deciding if a restart has succeeded, specified as a duration (default: decide immediately).
# working_dir: /home/ergo
logging:
driver: "json-file"
options:
max-file: 5
max-size: 10m
profiles:
- dev
# command: tail /dev/null -f
entrypoint: tail /dev/null -f
# entrypoint: java -jar -Xmx3G -Dlogback.stdout.level=${ERGONODE_LOGLEVEL} -Dlogback.file.level=${ERGONODE_LOGLEVEL} ergo.jar --${ERGONODE_NETWORK} -c /etc/myergo.conf
# only in dev.yml
ergonode4:
container_name: ergonode4
env_file: .env.production.local
image: ergoplatform/ergo
volumes:
# - ./ergonode/ergonode2:/opt/ergo # jar/conf
- ergonode4_data:/home/ergo/.ergo # blockchain
- ./ergonode/myergo4.conf:/etc/myergo.conf
ports:
- 9055:9053
environment:
- MAX_HEAP=3G
# working_dir: /home/ergo
deploy:
restart_policy:
condition: on-failure # One of none, on-failure or any (default: any).
delay: 2s
# max_attempts: 3
window: 30s # How long to wait before deciding if a restart has succeeded, specified as a duration (default: decide immediately).
logging:
driver: "json-file"
options:
max-file: 5
max-size: 10m
# command: tail /dev/null -f
# entrypoint: tail /dev/null -f
entrypoint: java -jar -Xmx5G -Dlogback.stdout.level=DEBUG -Dlogback.file.level=ERROR ergo.jar --mainnet -c /etc/myergo.conf
assembler:
container_name: assembler
env_file: .env.development.local
image: openjdk:11.0.13-jdk-buster
volumes:
- ./assembler/:/opt/assembler
ports:
- ${ASSEMBLER_PORT}:${ASSEMBLER_PORT}
working_dir: /opt/assembler # set this if using image and not build
logging:
driver: "json-file"
options:
max-file: 5
max-size: 10m
command: java -jar -Dconfig.file=${ASSEMBLER_CONF} -Dhttp.port=${ASSEMBLER_PORT} ${ASSEMBLER_JAR}
# ergostratum:
# container_name: ergostratum
# env_file: .env.development.local
# build:
# context: .
# dockerfile: Dockerfile.stratum
# volumes: './stratum:/opt/ergo'
# ports: 8008:8008 # stratum
# depends_on: ergonode
# command: nodemon ./tulip.js -e js # restart on js file changes
volumes:
postgres_data_dev:
redis_data_dev:
ergonode4_data:
ergonode_data: