Last active
January 16, 2025 08:34
-
-
Save Tknott95/22f2f067764ae62215576d17afda5267 to your computer and use it in GitHub Desktop.
node and sync (external psql) - docker-compose.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: nodes_and_syncs | |
services: | |
relay: | |
container_name: relay | |
build: | |
context: . # Assuming Dockerfile is in the current directory | |
image: ghcr.io/intersectmbo/cardano-node:10.1.3 | |
ports: | |
- "3001:3001" | |
volumes: | |
- cardano-node-ipc:/ipc | |
- cardano-node-data:/data | |
- /mnt/id3/MithrilSnapshots/122224/db:/data/db | |
environment: | |
- NETWORK=mainnet | |
restart: always | |
dbsync: | |
container_name: dbsync | |
network_mode: "host" | |
image: ghcr.io/intersectmbo/cardano-db-sync:13.3.0.0 | |
environment: | |
# - NETWORK=${NETWORK:-mainnet} - COMMENTED OUT IF USING db-sync-config.json | |
- POSTGRES_HOST=0.0.0.0 # Use localhost for your local PostgreSQL | |
- POSTGRES_PORT=5432 # Ensure this is the correct port | |
- POSTGRES_DB=cexplorer | |
- POSTGRES_USER=postgres | |
- PGSSLMODE=disable | |
- CARDANO_NODE_SOCKET_PATH=/ipc/node.socket | |
- EXTRA_DB_SYNC_ARGS=' --state-dir ./ledger-state/mainnet/ --schema-dir ./schema' | |
- RESTORE_RECREATE_DB=N | |
command: --socket-path /ipc/node.socket --config ./config/db-sync-config.json # Adjusted to use config and socket path | |
restart: on-failure | |
logging: | |
driver: "json-file" | |
options: | |
max-size: "200k" | |
max-file: "10" | |
volumes: | |
- db-sync-data:/var/lib/cexplorer | |
- cardano-node-ipc:/ipc | |
- ./config/:/config/ | |
- ./ledger-state/mainnet/:/ledger-state/mainnet/ | |
- ./schema:/schema/ | |
volumes: | |
cardano-node-ipc: | |
cardano-node-data: | |
db-sync-data: | |
networks: | |
default: | |
name: postgres |
db-sync.config.json you need to change the node socket so it doesn't point wrong as it will point to /node-ipc/ while node is at \ipc\ even if you override the env vars. Get the rest via curl -O from official sources.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.