-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
181 lines (172 loc) · 3.99 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
version: '2.4'
services:
dbconfig:
image: alpine:latest
volumes:
- conf:/app/conf # Mount the config directory on the host to the container
command: |
/bin/sh -c "echo 'host: postgres
port: 5432
user: ${DB_USER}
password: ${DB_PASSWORD}
dbname: oreowallet
default_pool_size: 200
protocol: \"postgres\"' > /app/conf/dbconfig"
postgres:
image: postgres:latest
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: oreowallet
ports:
- "${DB_PORT}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- oreowallet_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
interval: 10s
timeout: 5s
retries: 5
migration:
build: .
image: "oreowallet"
command: /bin/sh -c "./sqlx database create && ./sqlx migrate run"
environment:
- DATABASE_URL=postgres://${DB_USER}:${DB_PASSWORD}@postgres:5432/oreowallet
networks:
- oreowallet_network
depends_on:
- postgres
- dbconfig
logging:
driver: "json-file"
options:
max-file: "4"
max-size: "25m"
chainloader:
build: .
restart: always
image: "oreowallet"
command: ./chain_loader --dbconfig /app/conf/dbconfig --node ${NODE_HOST}:${NODE_PORT} --verbosity ${VERBOSITY:-0}
volumes:
- conf:/app/conf
depends_on:
- migration
networks:
- oreowallet_network
ulimits:
core:
hard: 0
soft: 0
logging:
driver: "json-file"
options:
max-file: "4"
max-size: "25m"
prover:
build: .
restart: always
image: "oreowallet"
command: ./prover --verbosity ${VERBOSITY:-0}
ports:
- "10002:10002"
depends_on:
- migration
- chainloader
networks:
- oreowallet_network
ulimits:
core:
hard: 0
soft: 0
logging:
driver: "json-file"
options:
max-file: "4"
max-size: "25m"
server:
build: .
restart: always
image: "oreowallet"
environment:
- SECRET_KEY=${SECRET_KEY}
- PUBLIC_KEY=${PUBLIC_KEY}
- ENABLE_AUTH=${ENABLE_AUTH:-false}
command: |
./server --listen 0.0.0.0:${SERVER_PORT} --dbconfig /app/conf/dbconfig --node ${NODE_HOST}:${NODE_PORT} --scan dservice:20001 --verbosity ${VERBOSITY:-0}
ports:
- "${SERVER_PORT}:${SERVER_PORT}"
volumes:
- conf:/app/conf
depends_on:
- migration
- chainloader
networks:
- oreowallet_network
ulimits:
core:
hard: 0
soft: 0
logging:
driver: "json-file"
options:
max-file: "4"
max-size: "25m"
dservice:
build: .
restart: always
image: "oreowallet"
environment:
- SECRET_KEY=${SECRET_KEY}
- PUBLIC_KEY=${PUBLIC_KEY}
command: ./dservice --dbconfig /app/conf/dbconfig --node ${NODE_HOST}:${NODE_PORT} --server server:${SERVER_PORT} --verbosity ${VERBOSITY:-0}
ports:
- "10001:10001"
- "20001:20001"
volumes:
- conf:/app/conf
depends_on:
- migration
- chainloader
networks:
oreowallet_network:
ipv4_address: 172.19.0.10
ulimits:
core:
hard: 0
soft: 0
logging:
driver: "json-file"
options:
max-file: "4"
max-size: "25m"
dworker:
build: .
restart: always
image: "oreowallet"
command: ./dworker --address 172.19.0.10:10001 --verbosity ${VERBOSITY:-0}
depends_on:
- migration
- chainloader
networks:
- oreowallet_network
ulimits:
core:
hard: 0
soft: 0
logging:
driver: "json-file"
options:
max-file: "4"
max-size: "25m"
networks:
oreowallet_network:
driver: bridge
ipam:
config:
- subnet: 172.19.0.0/16
volumes:
postgres_data:
conf: