mirror of
https://github.com/Permissionless-Software-Foundation/psf-bch-api-base.git
synced 2026-09-21 16:52:00 -07:00
fix(Docker): Can change URL in api docs
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user