Skip to content

Instantly share code, notes, and snippets.

@jcstein
Created May 29, 2025 09:42
Show Gist options
  • Save jcstein/6407ed9bc1368416eab2660866f460dd to your computer and use it in GitHub Desktop.
Save jcstein/6407ed9bc1368416eab2660866f460dd to your computer and use it in GitHub Desktop.
light node v0.22.2-mocha
version: "3.8"
services:
celestia-node:
image: ghcr.io/celestiaorg/celestia-node:v0.22.2-mocha
container_name: celestia-node
entrypoint: ["/bin/sh", "-c"]
command: >
'if [ ! -d "/home/celestia/.celestia-light-mocha-4" ]; then
echo "Running init...";
celestia light init --p2p.network mocha;
fi;
echo "Starting light node...";
celestia light start
--core.ip rpc-mocha.pops.one
--core.port 9090
--p2p.network mocha
--rpc.skip-auth
--rpc.addr 0.0.0.0'
volumes:
- celestia-data:/home/celestia
networks:
- celestia-network
ports:
- "26658:26658"
restart: unless-stopped
volumes:
celestia-data:
driver: local
networks:
celestia-network:
driver: bridge
@jcstein
Copy link
Author

jcstein commented May 29, 2025

🧠 AI Summary: Why the Original Docker Compose Setup Failed and How the Fixed Version Works

The original multi-container setup split celestia light init and celestia light start into separate services, relying on a shared volume and depends_on. This caused unreliable behavior because:

  • docker-compose doesn’t guarantee that the init container fully completes and flushes data before the start container begins.
  • If the start container runs without a valid light node store, the celestia CLI silently defaults to bridge init, writing bridge configs and keys to /home/celestia.
  • This results in a polluted volume with both bridge and light state, causing confusion and potential crashes.

✅ The fixed version runs everything in a single container with a shell-script entrypoint, which:

  • Checks for .celestia-light-mocha-4 and only runs init if needed
  • Performs safety checks on config files
  • Patches config.toml before starting the node
  • Prevents bridge init fallback by explicitly controlling the CLI flow

It also uses the correct Mocha-specific image (v0.22.2-mocha) and production RPC (rpc-mocha.pops.one), which avoids connection and sync issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment