Browse Source

expose ports

Fabian Peter Hammerle 3 years ago
parent
commit
16a07a229c
2 changed files with 7 additions and 1 deletions
  1. 4 1
      Dockerfile
  2. 3 0
      docker-compose.yml

+ 4 - 1
Dockerfile

@@ -12,4 +12,7 @@ RUN apk add --no-cache bitcoin=$BITCOIN_CORE_PACKAGE_VERSION \
 VOLUME $DATA_DIR_PATH
 
 USER bitcoin
-CMD ["sh", "-c", "exec bitcoind -datadir=\"$DATA_DIR_PATH\""]
+EXPOSE 8333/tcp
+# json-rpc api
+EXPOSE 8332/tcp
+CMD ["sh", "-c", "exec bitcoind -datadir=\"$DATA_DIR_PATH\" -rpcbind=0.0.0.0 -rpcallowip=172.16.0.0/12"]

+ 3 - 0
docker-compose.yml

@@ -13,6 +13,9 @@ services:
       source: data
       target: /var/lib/bitcoin
     read_only: yes
+    ports:
+    - '8333:8333'
+    - '127.0.0.1:8332:8332'
     cap_drop: [ALL]
     security_opt: [no-new-privileges]
     cpus: 0.5