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
|
||||
# ct-base-ubuntu = ubuntu 18.04 + nodejs v10 LTS
|
||||
#FROM christroutner/ct-base-ubuntu
|
||||
FROM ubuntu:22.04
|
||||
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
|
||||
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,
|
||||
# and `stage` has the most up-to-date changes.
|
||||
WORKDIR /home/safeuser/REST2NOSTR
|
||||
|
||||
# For development: switch to unstable branch
|
||||
#RUN git checkout pin-ipfs
|
||||
WORKDIR /home/safeuser/psf-bch-api
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
RUN npm install minimal-slp-wallet
|
||||
|
||||
# Generate the API 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.
|
||||
#EXPOSE 5011
|
||||
CMD ["npm", "start"]
|
||||
|
||||
# Start the application.
|
||||
#COPY start-production.sh start-production.sh
|
||||
VOLUME start-rest2nostr.sh
|
||||
CMD ["./start-rest2nostr.sh"]
|
||||
|
||||
#CMD ["npm", "start"]
|
||||
# Used to debug the container.
|
||||
#COPY temp.js temp.js
|
||||
#CMD ["node", "temp.js"]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Start the service with the command 'docker-compose up -d'
|
||||
|
||||
services:
|
||||
rest2nostr:
|
||||
psf-bch-api:
|
||||
build: .
|
||||
container_name: rest2nostr
|
||||
container_name: psf-bch-api
|
||||
logging:
|
||||
driver: 'json-file'
|
||||
options:
|
||||
@@ -15,5 +15,6 @@ services:
|
||||
ports:
|
||||
- '5942:5942' # <host port>:<container port>
|
||||
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
|
||||
@@ -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