Skip to content

Commit cc2a49f

Browse files
committed
feature: Add DB_SYNC_CONFIG to docker compose file
1 parent cae6b94 commit cc2a49f

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

doc/docker.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,30 @@ To connect to different network (preprod or preview) use `NETWORK` environment v
6666
NETWORK=preprod docker-compose up -d && docker-compose logs -f
6767
```
6868

69+
### Overriding Configuration
70+
71+
Overriding the configuration file can be done by passing the `DB_SYNC_CONFIG` environment
72+
variable. First, add a bind mount to the `cardano-db-sync` service:
73+
74+
```yaml
75+
cardano-db-sync:
76+
image: cardano-db-sync
77+
# <-- Snip -->
78+
volumes:
79+
- db-sync-data:/var/lib/cexplorer
80+
- node-ipc:/node-ipc
81+
# Add the bind mount here
82+
- ./config/network/mainnet:/data
83+
# <-- Snip -->
84+
```
85+
86+
Set the configuration file with `DB_SYNC_CONFIG`:
87+
88+
```sh
89+
export DB_SYNC_CONFIG=/data/db-sync-config.json
90+
docker-compose up -d && docker-compose logs -f
91+
```
92+
6993
### Take control
7094

7195
Excluding the `NETWORK` ENV will simply just call the `cardano-db-sync` executable

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ services:
5555
cardano-db-sync:
5656
image: ghcr.io/intersectmbo/cardano-db-sync:13.3.0.0
5757
environment:
58+
- DB_SYNC_CONFIG=${DB_SYNC_CONFIG:-}
5859
- DISABLE_LEDGER=${DISABLE_LEDGER}
5960
- NETWORK=${NETWORK:-mainnet}
6061
- POSTGRES_HOST=postgres

0 commit comments

Comments
 (0)