feat: implement simple docker compose dev env

refs #62
This commit is contained in:
fusion44 2022-03-20 19:55:52 +01:00
parent 516550bd9f
commit 84fecd1dcc
No known key found for this signature in database
GPG key ID: 645FA807E935D9D5
4 changed files with 73 additions and 0 deletions

1
.gitignore vendored
View file

@ -4,3 +4,4 @@ __pycache__
.coverage
htmlcov
scripts/sync_to_blitz.personal.sh
docker/.env

3
docker/.env.sample Normal file
View file

@ -0,0 +1,3 @@
BITCOIND_DATA_PATH=/home/username/.blitz_api/docker_bitcoin_data
LND_1_DATA_PATH=/home/username/.blitz_api/docker_lnd_1
LND_2_DATA_PATH=/home/username/.blitz_api/docker_lnd_2

8
docker/README.md Normal file
View file

@ -0,0 +1,8 @@
# Blitz API Dockerized
## Start a dev env
This exists to setup a simple Bitcoin Testnet environment to develop the API.
* Copy `.env.sample` to `.env` and edit the variable as necessary
* Run `docker-compose up --env-file .env` within this folder.

61
docker/docker-compose.yml Normal file
View file

@ -0,0 +1,61 @@
version: '3'
services:
bitcoin-core:
image: ruimarinho/bitcoin-core
stop_grace_period: 1m
command:
-printtoconsole
-testnet=1
-server=1
-rpcallowip=0.0.0.0/0
-rpcbind=0.0.0.0
-rpcuser=bitcoin
-rpcpassword=bitcoin
-zmqpubrawblock=tcp://0.0.0.0:28332
-zmqpubrawtx=tcp://0.0.0.0:28333
volumes:
- ${BITCOIND_DATA_PATH}:/home/bitcoin/.bitcoin
ports:
- 18332:18332
- 18333:18333
- 28332:28332
- 28333:28333
lnd_1:
image: lightninglabs/lnd:v0.14.1-beta
stop_grace_period: 1m
command:
--bitcoin.active
--bitcoin.testnet
--bitcoin.node=bitcoind
--bitcoind.rpcuser=bitcoin
--bitcoind.rpcpass=bitcoin
--bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332
--bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333
--norest
depends_on:
- "bitcoin-core"
volumes:
- ${LND_1_DATA_PATH}:/root/.lnd
ports:
- 8080:8080
- 10009:10009
lnd_2:
image: lightninglabs/lnd:v0.14.1-beta
stop_grace_period: 1m
command:
--bitcoin.active
--bitcoin.testnet
--bitcoin.node=bitcoind
--bitcoind.rpcuser=bitcoin
--bitcoind.rpcpass=bitcoin
--bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332
--bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333
--norest
depends_on:
- "bitcoin-core"
volumes:
- ${LND_2_DATA_PATH}:/root/.lnd
ports:
- 8081:8081
- 10010:10009