From 7d1c69f0f2a1f521ed495a04cd2cb43fca83d207 Mon Sep 17 00:00:00 2001 From: Jurvis Tan Date: Mon, 14 Nov 2022 19:59:17 -0800 Subject: [PATCH] Create simple docker-compose for testnet --- docker-compose.yml | 77 +++++++++++++++++++++++++++++++++++++++++++ docker/Dockerfile.rgs | 9 +++++ 2 files changed, 86 insertions(+) create mode 100644 docker-compose.yml create mode 100644 docker/Dockerfile.rgs diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..ea13ea8 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,77 @@ +version: "3" + +services: + rgs_server: + build: + context: '$PWD' + dockerfile: '$PWD/docker/Dockerfile.rgs' + volumes: + - '$PWD:/usr/src/app:cached' + links: + - postgres + - bitcoin-core + depends_on: + - postgres + environment: + - RAPID_GOSSIP_SYNC_SERVER_DB_HOST=postgres + - RAPID_GOSSIP_SYNC_SERVER_DB_USER=lightning-rgs + - RAPID_GOSSIP_SYNC_SERVER_DB_PASSWORD=docker + - RAPID_GOSSIP_SYNC_SERVER_DB_NAME=ln_graph_sync + - BITCOIN_REST_DOMAIN=bitcoin-core + - BITCOIN_REST_PORT=8332 + - BITCOIN_REST_PATH=/rest/ + command: 'cargo run' + + postgres: + image: 'postgres:12-alpine' + ports: + - 5432:5432 + volumes: + - postgres:/var/lib/postgresql/data + environment: + - POSTGRES_USER=lightning-rgs + - POSTGRES_PASSWORD=docker + - POSTGRES_DB=ln_graph_sync + + bitcoin-core: + container_name: bitcoin-core + image: ruimarinho/bitcoin-core:alpine + restart: always + ports: + - "0.0.0.0:8332:8332" + - "0.0.0.0:8333:8333" + volumes: + - /etc/localtime:/etc/localtime:ro + - .bitcoin:/home/bitcoin/.bitcoin + command: + - "-printtoconsole" + - "-rpcallowip=0.0.0.0/0" + - "-rpcbind=0.0.0.0" + - "-rpcuser=vault" + - "-rpcpassword=vault" + - "-rpcport=8332" + - "-rest" + + # Comment Out Below for Testnet. You'll also need to change BITCOIN_REST_PORT to 18332 + # bitcoin-core: + # container_name: bitcoin-core + # image: ruimarinho/bitcoin-core:alpine + # restart: always + # ports: + # - "0.0.0.0:18332:18332" + # - "0.0.0.0:18332:18333" + # volumes: + # - /etc/localtime:/etc/localtime:ro + # - .bitcoin:/home/bitcoin/.bitcoin + # command: + # - "-printtoconsole" + # - "-testnet" + # - "-rpcallowip=0.0.0.0/0" + # - "-rpcbind=0.0.0.0" + # - "-rpcuser=vault" + # - "-rpcpassword=vault" + # - "-rpcport=18332" + # - "-rest" + +volumes: + postgres: null diff --git a/docker/Dockerfile.rgs b/docker/Dockerfile.rgs new file mode 100644 index 0000000..3cd9fe0 --- /dev/null +++ b/docker/Dockerfile.rgs @@ -0,0 +1,9 @@ +FROM rust:1.64 + +WORKDIR /usr/src/app + +COPY . . + +RUN cargo install --path . + +EXPOSE 8000 -- 2.39.5