fix(production): Updated Docker container

This commit is contained in:
Chris Troutner
2021-07-17 10:54:00 -07:00
parent 71fbebe672
commit 3c8d2cfdd3
5 changed files with 47 additions and 20 deletions
+5 -1
View File
@@ -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
}
+13 -10
View File
@@ -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" # <host port>:<container port>
- '5555:27017' # <host port>:<container port>
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" # <host port>:<container port>
# <host port>:<container port>
- '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
+9 -8
View File
@@ -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
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
# Remove all untagged docker images.
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
+15 -1
View File
@@ -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