]> git.bitcoin.ninja Git - rapid-gossip-sync-server/commitdiff
Create simple docker-compose for testnet
authorJurvis Tan <hello@jurvis.co>
Tue, 15 Nov 2022 03:59:17 +0000 (19:59 -0800)
committerJurvis Tan <hello@jurvis.co>
Tue, 15 Nov 2022 04:20:06 +0000 (20:20 -0800)
docker-compose.yml [new file with mode: 0644]
docker/Dockerfile.rgs [new file with mode: 0644]

diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644 (file)
index 0000000..ea13ea8
--- /dev/null
@@ -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 (file)
index 0000000..3cd9fe0
--- /dev/null
@@ -0,0 +1,9 @@
+FROM rust:1.64
+
+WORKDIR /usr/src/app
+
+COPY . .
+
+RUN cargo install --path .
+
+EXPOSE 8000