diff --git a/production/docker/.env-local b/production/docker/.env-local new file mode 100644 index 0000000..6c7bfcd --- /dev/null +++ b/production/docker/.env-local @@ -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 + diff --git a/production/docker/Dockerfile b/production/docker/Dockerfile index 0ffac4f..c1cc87f 100644 --- a/production/docker/Dockerfile +++ b/production/docker/Dockerfile @@ -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 @@ -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"] diff --git a/production/docker/docker-compose.yml b/production/docker/docker-compose.yml index 862e5f9..881d8d8 100644 --- a/production/docker/docker-compose.yml +++ b/production/docker/docker-compose.yml @@ -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' # : 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 \ No newline at end of file diff --git a/production/docker/temp.js b/production/docker/temp.js new file mode 100644 index 0000000..02ffedc --- /dev/null +++ b/production/docker/temp.js @@ -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...') +