diff --git a/config/env/common.js b/config/env/common.js index 8665297..6d34e44 100644 --- a/config/env/common.js +++ b/config/env/common.js @@ -54,5 +54,9 @@ module.exports = { name: 'Permissionless Software Foundation', url: 'https://PSFoundation.cash' } - } + }, + + // IPFS Ports + ipfsTcpPort: process.env.IPFS_TCP_PORT ? process.env.IPFS_TCP_PORT : 5668, + ipfsWsPort: process.env.IPFS_WS_PORT ? process.env.IPFS_WS_PORT : 5669 } diff --git a/docker-compose.yml b/docker-compose.yml index 67d0af8..6279a0a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,25 +1,28 @@ # Start the testnet server with the command 'docker-compose up -d' -koa-mongodb: +bch-wallet-mongodb: image: mongo - container_name: mongo-koa + container_name: mongo-bch-service ports: - - "5555:27017" # : + - '5555:27017' # : volumes: - ./database:/data/db - command: mongod --smallfiles --logpath=/dev/null # -- quiet + command: mongod --logpath=/dev/null # -- quiet restart: always -koa: +bch-wallet-service: build: ./production/ dockerfile: Dockerfile - container_name: koa + container_name: bch-wallet-service links: - - koa-mongodb + - bch-wallet-mongodb ports: - - "5001:5001" # : + # : + - '5001:5001' # REST API + - '5668:5668' # IPFS TCP Port + - '5669:5669' # IPFS WS Port volumes: -# - ./logs:/home/coinjoin/consolidating-coinjoin/logs - - ./keys:/home/safeuser/keys + - ./ipfsdata:/home/safeuser/ipfsdata + - ./orbitdb:/home/safeuser/orbitdb restart: always diff --git a/production/Dockerfile b/production/Dockerfile index c97f57d..790a9c2 100644 --- a/production/Dockerfile +++ b/production/Dockerfile @@ -29,13 +29,13 @@ RUN echo 'abcd8765' | sudo -S pwd # Clone the rest.bitcoin.com repository WORKDIR /home/safeuser -RUN git clone https://github.com/christroutner/koa-api-boilerplate -RUN mv koa-api-boilerplate koa -RUN mkdir keys +RUN git clone https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-service +# RUN mv koa-api-boilerplate koa +# RUN mkdir keys # Switch to the desired branch. `master` is usually stable, # and `stage` has the most up-to-date changes. -WORKDIR /home/safeuser/koa +WORKDIR /home/safeuser/ipfs-bch-wallet-service # For development: switch to unstable branch # RUN git checkout unstable @@ -46,10 +46,11 @@ RUN npm install # Generate the API docs RUN npm run docs -VOLUME /home/safeuser/keys - -# Expose the port the API will be served on. -EXPOSE 5001 +# Calling out the directorys that should be mounted as external volumes. +RUN mkdir /home/safeuser/ipfsdata +RUN mkdir /home/safeuser/orbitdb +VOLUME /home/safeuser/ipfsdata +VOLUME /home/safeuser/orbitdb # Start the application. COPY start-production start-production diff --git a/production/cleanup-images.sh b/production/cleanup-images.sh new file mode 100644 index 0000000..405d9f5 --- /dev/null +++ b/production/cleanup-images.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# Remove all untagged docker images. +docker rmi $(docker images | grep "^" | awk '{print $3}') + diff --git a/production/start-production b/production/start-production index 155efee..10b92e3 100755 --- a/production/start-production +++ b/production/start-production @@ -1,3 +1,17 @@ #!/bin/bash -export KOA_ENV=production + +# Customize these environment variables for your own installation. +export AUTHSERVER=https://auth.fullstack.cash +export APISERVER=https://api.fullstack.cash/v5/ +export FULLSTACKLOGIN=demo@demo.com +export FULLSTACKPASS=demo + +# Ports +export PORT=5001 # REST API +export IPFS_TCP_PORT=5668 # IPSF TCP Port +export IPFS_WS_PORT=5669 # IPFS WS Port + +#export ENABLE_CIRCUIT_RELAY=1 + +export SVC_ENV=production npm start