Skip to content
Lincon Vidal edited this page Jul 29, 2024 · 11 revisions

Docker builds are available on DockerHub:

As the service dependencies are all defined in their own images, the docker-compose.yml is used to provide a self-documenting starting point for your own deployment. It is advised to check a copy into source control, and configure it further to meet your requirements. The default configuration uses the IOHK-managed mainnet config, however you can pass NETWORK=testnet or mount you own config for complete control.

System Requirements

Start in detached mode, then view output from containers

docker compose up -d --build && docker compose logs -f

The initial sync will take some time, but the GraphQL Playground will be available at http://localhost:3100 to check on the sync progress using this query. You can freely stop, stop, and rebuild the stack but retain the volumes under normal circumstances to persist the node and db state. Once initialized the API is considered ready for use.

List containers

docker compose ps -a

Show logs from a specific service

docker compose logs -f cardano-graphql

Display running processes

docker compose top

Stop the stack

docker compose stop

Rebuild Cardano DB

If instructed to rebuild the database, @cardano-graphql/cli has a command to avoid unnecessarily dropping the cardano-node volume, and optionally performing a managed backup that can be rolled back.

cgql docker rebuild-service
# Follow instructions, selecting postgres only

If a backup is not required, and you wish to not use the CLI:

docker compose stop
docker volume ls
# copy the volume ending in *_postgres-data to the clipboard
docker volume rm [PASTE]
docker volume ls
# copy the volume ending in *_db-sync-data to the clipboard
docker volume rm [PASTE]

Now follow the Getting Started instructions in the README.

Stop and remove containers, networks, images, and volumes

⚠️ Only do this if you need to wipe all state from the host.

docker compose down -v

Troubleshooting

If you have a port clash on the host, change the mapping in the docker-compose