-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
206 lines (187 loc) · 4.44 KB
/
docker-compose.yml
File metadata and controls
206 lines (187 loc) · 4.44 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
version: "3.9"
volumes:
cardano_mainnet-ipc:
external: true
cardano_preprod-ipc:
external: true
cardano_preview-ipc:
external: true
postgres_primary:
postgres_replica:
networks:
dbsync:
name: dbsync
external: true
secrets:
postgres_password:
x-generated:
special: false
length: 15
dbsync_mainnet_password:
x-generated:
special: false
length: 15
dbsync_preprod_password:
x-generated:
special: false
length: 15
dbsync_preview_password:
x-generated:
special: false
length: 15
configs:
dbsync_config.json:
file: ./dbsync-config.json
dbsync_mainnet_user:
x-content: dbsync_mainnet
dbsync_preprod_user:
x-content: dbsync_preprod
dbsync_preview_user:
x-content: dbsync_preview
dbsync_mainnet_db:
x-content: dbsync_mainnet
dbsync_preprod_db:
x-content: dbsync_preprod
dbsync_preview_db:
x-content: dbsync_preview
# -----------------------------
# TEMPLATES (anchors)
# -----------------------------
x-dbsync-common: &dbsync-common
image: ghcr.io/cardanoapi/cardano-db-sync:13.6.0.7
environment: &dbsync-env
POSTGRES_HOST: postgres2
POSTGRES_PORT: 5432
DB_SYNC_CONFIG: /run/configs/dbsync_config.json
DISABLE_CACHE: ""
DISABLE_LEDGER: ""
DISABLE_EPOCH: ""
configs:
- source: dbsync_config.json
target: /run/configs/dbsync_config.json
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
deploy:
labels:
"co_elastic_logs/enable": "false"
placement:
constraints:
- node.labels.dbsync2 == true
restart_policy:
delay: 15s
x-postgres-common: &postgres-common
image: postgres:18.3
environment:
- POSTGRES_LOGGING=true
- POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
secrets:
- postgres_password
volumes:
- type: tmpfs
target: /dev/shm
tmpfs:
size: 8589934592
deploy:
labels:
"co_elastic_logs/enable": "false"
restart_policy:
delay: 15s
# -----------------------------
# SERVICES
# -----------------------------
services:
mainnet:
<<: *dbsync-common
environment:
<<: *dbsync-env
NETWORK: mainnet
configs:
- source: dbsync_config.json
target: /run/configs/dbsync_config.json
- source: dbsync_mainnet_user
target: postgres_user
- source: dbsync_mainnet_db
target: postgres_db
secrets:
- source: dbsync_mainnet_password
target: postgres_password
volumes:
- /srv/cardano/cardano_mainnet-dbsync/_data/:/var/lib/cexplorer
- cardano_mainnet-ipc:/node-ipc
preview:
<<: *dbsync-common
environment:
<<: *dbsync-env
NETWORK: preview
configs:
- source: dbsync_config.json
target: /run/configs/dbsync_config.json
- source: dbsync_preview_user
target: postgres_user
- source: dbsync_preview_db
target: postgres_db
secrets:
- source: dbsync_preview_password
target: postgres_password
volumes:
- /srv/cardano/cardano_preview-dbsync/_data/:/var/lib/cexplorer
- cardano_preview-ipc:/node-ipc
preprod:
<<: *dbsync-common
environment:
<<: *dbsync-env
NETWORK: preprod
configs:
- source: dbsync_config.json
target: /run/configs/dbsync_config.json
- source: dbsync_preprod_user
target: postgres_user
- source: dbsync_preprod_db
target: postgres_db
secrets:
- source: dbsync_preprod_password
target: postgres_password
volumes:
- /srv/cardano/cardano_preprod-dbsync/_data/:/var/lib/cexplorer
- cardano_preprod-ipc:/node-ipc
postgres2:
<<: *postgres-common
networks:
default:
dbsync:
aliases:
- dbsync2
- pg2
volumes:
- postgres_primary:/var/lib/postgresql/data
deploy:
placement:
constraints:
- node.labels.dbsync2 == true
ports:
- target: 5432
published: 8433
protocol: tcp
mode: host
replica:
<<: *postgres-common
networks:
dbsync:
aliases:
- dbsync-replica
- dbsync-read-replica
- read-replica
volumes:
- postgres_replica:/var/lib/postgresql/data
deploy:
placement:
constraints:
- node.labels.dbsync1 == true
ports:
- target: 5432
published: 8433
protocol: tcp
mode: host