feat: allow docker compose overrides

- use file override to handle multiple networks
- expose and map only required ports
- name containers differently
- add environment for chain variable
- dont expose ports in image
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
This commit is contained in:
Lakshya Singh
2023-09-26 00:40:53 +05:30
parent 0484ff6475
commit 5b0cb901cb
5 changed files with 68 additions and 28 deletions

View File

@@ -4,22 +4,11 @@ services:
build:
dockerfile: ./bitcoind/Dockerfile
image: bitcoind
container_name: bitcoind
command:
- --testnet
- -pid=/home/bitcoin/.bitcoin/testnet3/bitcoind-testnet.pid
container_name: bitcoind-test
volumes:
- data:/home/bitcoin/.bitcoin
expose:
- 8332
- 8333
- 18332
- 18333
- 18444
ports:
- 8333:8333
- 18333:18333
- 38333:38333
networks:
LN_testing:
aliases:
@@ -31,31 +20,24 @@ services:
build:
dockerfile: ./lightningd/Dockerfile
image: lightningd
container_name: lightningd
container_name: lightningd-test
command:
- --conf=/home/lightning/.lightning/testnet-config
- --conf=/home/lightning/.lightning/test-config
- --bitcoin-rpcconnect=bitcoind
- --bind-addr=core-lightning:19735
- --announce-addr=core-lightning:19735
volumes:
- clightning:/home/lightning/.lightning
expose:
- 9735
- 9835
ports:
- 9735:9735
- 19735:19735
- 19735
networks:
- LN_testing
links:
- bitcoin-core:bitcoind
depends_on:
bitcoin-core:
condition: service_healthy
restart: true
env_file:
- ./assets/testnet-env
- ./assets/test-env
environment:
- BITCOIN_CHAIN=test
volumes:
data:
@@ -66,4 +48,4 @@ volumes:
external: true
networks:
LN_testing:
LN_testing: