Skip to content

Instantly share code, notes, and snippets.

@BigOokie
Last active August 18, 2022 03:48
Show Gist options
  • Save BigOokie/ea60838fee0bfc7733662c8c1cfaafba to your computer and use it in GitHub Desktop.
Save BigOokie/ea60838fee0bfc7733662c8c1cfaafba to your computer and use it in GitHub Desktop.
Load-balanced Skycoin in Docker
1. Ensure Docker is installed.
2. Create a new pair of Docker Volumes for each the Skycoin Node instance
- `docker volume create skycoin-1-wallet`
- `docker volume create skycoin-1-data`
3. Create and run a new Docker container for the new instance.
- `docker run -d -v skycoin-1-data:/data/.skycoin -v skycoin-1-wallet:/wallet -p 6000:6000 -p 6420:6420 --name skycoin-node-1 skycoinproject/skycoin`
Repeat the above steps as many times as you want Skycoin Nodes. Make sure to do the following for each however:
- Create new volumes
- Map different host ports (6000 and 6420, 6001 and 6421, etc)
- Set different names for each container
Next ensure Caddy is installed then use the following template to configure Caddy (via the Caddyfile) to server and load-balance the instances:
skycoin.mydomain.com {
tls {
dns cloudflare
}
log stdout
errors
proxy / 10.1.1.1:6420 10.1.1.1:6421 {
health_check /api/v1/health
transparent
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment