-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose-prod.yml
178 lines (163 loc) · 4.53 KB
/
docker-compose-prod.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
version: '3.9'
services:
# copythis:
# container_name: template
# env_file: .env
# image: hello-world # or build
# volumes: .:/opt/hello
# ${SERVICE_PORT}:54321 # set in .env; # HOST:CONTAINER
nginx:
container_name: nginx
env_file: .env
image: nginx:1.17
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- ${NGINX_PORT}:80
profiles:
- all
- nginx
backend:
container_name: backend
env_file: .env
build:
context: .
dockerfile: Dockerfile.backend
volumes:
- ./backend/app:/app
ports:
- ${BACKEND_PORT}:${BACKEND_PORT}
depends_on:
- postgres
command: uvicorn main:app --reload --workers 4 --reload-dir /app --host 0.0.0.0 --port ${BACKEND_PORT}
frontend:
container_name: frontend
env_file: .env
build:
context: .
dockerfile: Dockerfile.frontend
volumes:
- ./frontend:/app
ports:
- ${FRONTEND_PORT}:${FRONTEND_PORT}
profiles:
- all
- frontend # this profile would need to be passed for this to be enabled
# command: yarn dev # start
command: tail /dev/null -f
postgres:
container_name: postgres
env_file: .env
image: postgres:14-alpine
restart: always
volumes:
- postgres_data:/var/lib/postgresql/data:cached
ports:
- ${POSTGRES_PORT}:5432
redis:
container_name: redis
env_file: .env
image: redis
volumes:
- redis_data:/data # redis persistence
ports:
- ${REDIS_PORT}:6379
entrypoint: redis-server --appendonly yes
pgadmin:
container_name: pgadmin
env_file: .env
image: dpage/pgadmin4
ports:
- ${PGADMIN_LISTEN_PORT}:${PGADMIN_LISTEN_PORT}
depends_on:
- postgres
profiles:
- all
aggregator:
container_name: aggregator
env_file: .env
build:
context: .
dockerfile: Dockerfile.aggregator
volumes:
- ./aggregator/app:/app
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
# command: tail /dev/null -f # stall
worker:
container_name: worker
env_file: .env
build:
context: .
dockerfile: Dockerfile.aggregator
volumes:
- ./aggregator/app:/app
command: celery --app tasks worker --loglevel=DEBUG -Q main-queue -c 1
# command: tail /dev/null -f # stall
flower:
container_name: flower
env_file: .env
image: mher/flower
ports:
- ${FLOWER_PORT}:${FLOWER_PORT}
depends_on:
- redis
command: celery flower --broker=redis://redis:${REDIS_PORT}/0 --port=${FLOWER_PORT}
ergonode:
container_name: ergonode
env_file: .env
image: openjdk
volumes:
- ./ergonode/:/opt/ergo # jar/conf
- /ergo/mainnet/.ergo:/opt/ergo/.ergo # blockchain
ports:
- ${ERGONODE_PORT}:${ERGONODE_PORT}
working_dir: /opt/ergo
logging:
driver: "json-file"
options:
max-file: 5
max-size: 10m
command: java -jar -Xmx3G -Dlogback.stdout.level=WARN -Dlogback.file.level=ERROR ergo.jar --mainnet -c mainnet.conf
ergonode2:
container_name: ergonode2
env_file: .env
image: openjdk
volumes:
- ./ergonode/:/opt/ergo # jar/conf
# - /ergo/ergonode2/.ergo:/opt/ergo/.ergo # blockchain
ports:
- ${ERGONODE2_PORT}:${ERGONODE2_PORT}
working_dir: /opt/ergo
logging:
driver: "json-file"
options:
max-file: 5
max-size: 10m
command: java -jar -Xmx3G -Dlogback.stdout.level=WARN -Dlogback.file.level=ERROR ergo.jar --mainnet -c ergonode2.conf
assembler:
container_name: assembler
env_file: .env
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
command: java -jar -Dconfig.file=mainnet.conf -Dhttp.port=${ASSEMBLER_PORT} ergo-assembler-1.1.jar
# command: tail /dev/null -f
# ergostratum:
# container_name: ergostratum
# env_file: .env
# 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:
redis_data: