mirror of
https://github.com/Permissionless-Software-Foundation/psf-bch-api.git
synced 2026-09-21 16:52:00 -07:00
fix(Docker): Creating docker container
This commit is contained in:
@@ -0,0 +1,34 @@
|
|||||||
|
# START INFRASTRUCTURE SETUP
|
||||||
|
|
||||||
|
# Full Node Connection
|
||||||
|
RPC_BASEURL=http://172.17.0.1:8332
|
||||||
|
RPC_USERNAME=bitcoin
|
||||||
|
RPC_PASSWORD=password
|
||||||
|
|
||||||
|
# Fulcrum Indexer
|
||||||
|
FULCRUM_API=http://172.17.0.1:3001/v1
|
||||||
|
|
||||||
|
# SLP Indexer
|
||||||
|
SLP_INDEXER_API=http://localhost:5010
|
||||||
|
|
||||||
|
# REST API URL for wallet operations
|
||||||
|
LOCAL_RESTURL=http://localhost:5942/v6
|
||||||
|
|
||||||
|
# END INFRASTRUCTURE SETUP
|
||||||
|
|
||||||
|
|
||||||
|
# START ACCESS CONTROL
|
||||||
|
|
||||||
|
# x402 payments required to access this API?
|
||||||
|
X402_ENABLED=false
|
||||||
|
#X402_ENABLED=true
|
||||||
|
#SERVER_BCH_ADDRESS=bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d
|
||||||
|
#FACILITATOR_URL=http://localhost:4345/facilitator
|
||||||
|
|
||||||
|
# Basic Authentication required to access this API?
|
||||||
|
USE_BASIC_AUTH=false
|
||||||
|
#USE_BASIC_AUTH=true
|
||||||
|
#BASIC_AUTH_TOKEN=some-random-token
|
||||||
|
|
||||||
|
# END ACCESS CONTROL
|
||||||
|
|
||||||
@@ -2,8 +2,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
#IMAGE BUILD COMMANDS
|
#IMAGE BUILD COMMANDS
|
||||||
# ct-base-ubuntu = ubuntu 18.04 + nodejs v10 LTS
|
|
||||||
#FROM christroutner/ct-base-ubuntu
|
|
||||||
FROM ubuntu:22.04
|
FROM ubuntu:22.04
|
||||||
MAINTAINER Chris Troutner <chris.troutner@gmail.com>
|
MAINTAINER Chris Troutner <chris.troutner@gmail.com>
|
||||||
|
|
||||||
@@ -47,39 +45,24 @@ RUN runuser -l safeuser -c "npm config set prefix '~/.npm-global'"
|
|||||||
|
|
||||||
# Clone the rest.bitcoin.com repository
|
# Clone the rest.bitcoin.com repository
|
||||||
WORKDIR /home/safeuser
|
WORKDIR /home/safeuser
|
||||||
RUN git clone https://github.com/christroutner/REST2NOSTR
|
RUN git clone https://github.com/Permissionless-Software-Foundation/psf-bch-api
|
||||||
|
|
||||||
# Switch to the desired branch. `master` is usually stable,
|
# Switch to the desired branch. `master` is usually stable,
|
||||||
# and `stage` has the most up-to-date changes.
|
# and `stage` has the most up-to-date changes.
|
||||||
WORKDIR /home/safeuser/REST2NOSTR
|
WORKDIR /home/safeuser/psf-bch-api
|
||||||
|
|
||||||
# For development: switch to unstable branch
|
|
||||||
#RUN git checkout pin-ipfs
|
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
RUN npm install minimal-slp-wallet
|
||||||
|
|
||||||
# Generate the API docs
|
# Generate the API docs
|
||||||
RUN npm run docs
|
RUN npm run docs
|
||||||
|
|
||||||
#VOLUME /home/safeuser/keys
|
COPY .env-local .env
|
||||||
|
|
||||||
# Make leveldb folders
|
|
||||||
#RUN mkdir leveldb
|
|
||||||
#WORKDIR /home/safeuser/psf-slp-indexer/leveldb
|
|
||||||
#RUN mkdir current
|
|
||||||
#RUN mkdir zips
|
|
||||||
#RUN mkdir backup
|
|
||||||
#WORKDIR /home/safeuser/psf-slp-indexer/leveldb/zips
|
|
||||||
#COPY restore-auto.sh restore-auto.sh
|
|
||||||
#WORKDIR /home/safeuser/psf-slp-indexer
|
|
||||||
|
|
||||||
# Expose the port the API will be served on.
|
CMD ["npm", "start"]
|
||||||
#EXPOSE 5011
|
|
||||||
|
|
||||||
# Start the application.
|
# Used to debug the container.
|
||||||
#COPY start-production.sh start-production.sh
|
#COPY temp.js temp.js
|
||||||
VOLUME start-rest2nostr.sh
|
#CMD ["node", "temp.js"]
|
||||||
CMD ["./start-rest2nostr.sh"]
|
|
||||||
|
|
||||||
#CMD ["npm", "start"]
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
# Start the service with the command 'docker-compose up -d'
|
# Start the service with the command 'docker-compose up -d'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
rest2nostr:
|
psf-bch-api:
|
||||||
build: .
|
build: .
|
||||||
container_name: rest2nostr
|
container_name: psf-bch-api
|
||||||
logging:
|
logging:
|
||||||
driver: 'json-file'
|
driver: 'json-file'
|
||||||
options:
|
options:
|
||||||
@@ -15,5 +15,6 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- '5942:5942' # <host port>:<container port>
|
- '5942:5942' # <host port>:<container port>
|
||||||
volumes:
|
volumes:
|
||||||
- ./start-rest2nostr.sh:/home/safeuser/REST2NOSTR/start-rest2nostr.sh
|
#- ./start-rest2nostr.sh:/home/safeuser/REST2NOSTR/start-rest2nostr.sh
|
||||||
|
- ./.env:/home/safeuser/.env
|
||||||
restart: always
|
restart: always
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
// Simple Node.js app that prints 'hello world' every 10 seconds
|
||||||
|
|
||||||
|
setInterval(() => {
|
||||||
|
console.log('hello world')
|
||||||
|
}, 10000)
|
||||||
|
|
||||||
|
console.log('Timer started. Printing "hello world" every 10 seconds...')
|
||||||
|
|
||||||
Reference in New Issue
Block a user