fix(Docker): Can change URL in api docs

This commit is contained in:
Chris Troutner
2026-04-01 08:57:10 -07:00
parent 5d77880a0e
commit 67b141fc03
8 changed files with 90 additions and 7 deletions
+4
View File
@@ -16,6 +16,10 @@ LOCAL_RESTURL=http://172.17.0.1:5942/v6
# END INFRASTRUCTURE SETUP
# Public base URL for apiDoc HTML (set per deployment / subdomain).
# Applied at container start before `npm run docs`. Example: https://api.example.com
#APIDOC_URL=https://api.example.com
# START ACCESS CONTROL
+7 -5
View File
@@ -57,13 +57,15 @@ RUN git checkout ct-unstable
RUN npm install
RUN npm install minimal-slp-wallet
# Generate the API docs
RUN npm run docs
# Runtime entrypoint + apidoc URL patch (see production/docker/entrypoint.sh).
# API docs are generated at container start so APIDOC_URL can be set per deployment.
COPY production/docker/entrypoint.sh /home/safeuser/psf-bch-api/entrypoint.sh
COPY scripts/patch-apidoc-from-env.js /home/safeuser/psf-bch-api/scripts/patch-apidoc-from-env.js
RUN chmod +x /home/safeuser/psf-bch-api/entrypoint.sh
COPY .env .env
# Runtime `.env` is provided by docker-compose (mount at psf-bch-api/.env), not baked into the image.
CMD ["npm", "start"]
ENTRYPOINT ["/home/safeuser/psf-bch-api/entrypoint.sh"]
# Used to debug the container.
#COPY temp.js temp.js
+4 -2
View File
@@ -2,7 +2,9 @@
services:
psf-bch-api:
build: .
build:
context: ../..
dockerfile: production/docker/Dockerfile
container_name: psf-bch-api
logging:
driver: 'json-file'
@@ -16,7 +18,7 @@ services:
- '5942:5942' # <host port>:<container port>
volumes:
#- ./start-rest2nostr.sh:/home/safeuser/REST2NOSTR/start-rest2nostr.sh
- ./.env:/home/safeuser/.env
- ./.env:/home/safeuser/psf-bch-api/.env
- ../data:/home/safeuser/psf-bch-api/production/data
- ../data/logs:/home/safeuser/psf-bch-api/logs
restart: always
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
set -euo pipefail
cd /home/safeuser/psf-bch-api
node scripts/patch-apidoc-from-env.js
npm run docs
exec npm start