Docker is the recommended way to run S1 Backend in production. The repository ships aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/PDNMX/s1_backend/llms.txt
Use this file to discover all available pages before exploring further.
dockerfile based on node:12-alpine and a Docker Compose file that wires the service into an external Docker network named DEMOSPDN. Together they provide a reproducible, self-contained deployment with a single docker-compose up command.
Prerequisites
Before deploying, make sure you have the following in place:- Docker ≥ 20.x installed and running
- Docker Compose ≥ 1.29 installed
- A completed
endpoints.jsonfile in the project root (see Configuration for the full schema)
Building the Image
Thedockerfile at the project root defines a single-stage build on top of the official Node.js 12 Alpine image. It installs dependencies with Yarn, cleans the cache, and exposes the port declared by the PORT environment variable.
The
dockerfile is based on node:12-alpine to keep the image footprint small. PORT is a runtime environment variable — it is read by bin/www when the Node.js process starts (process.env.PORT || '3000'). Because the Dockerfile declares no ARG PORT, the EXPOSE ${PORT} line does not resolve to a specific port number at build time; port exposure is effectively handled by the Docker Compose ports mapping at runtime. When using Docker Compose, PORT is read from your shell environment or a .env file automatically.Running with Docker Compose
The includeddocker-compose.yml builds and runs the api service, maps the container port to the same host port, and joins the service to a pre-existing external Docker network called DEMOSPDN.
External network — DEMOSPDN
The compose file declaresDEMOSPDN as an external network, meaning Docker Compose will not create it automatically. You must create it once on the host before bringing the stack up:
Starting the stack
Set thePORT variable in your shell (or in a .env file at the project root — see Environment Variables) and run:
-d flag runs the stack in detached mode. Docker Compose will build the image if it has not been built yet and then start the api container with restart: always, so the service will come back automatically after a host reboot.
Verifying the Deployment
Once the container is running, confirm the API is responding:Stopping the Service
To bring the stack down gracefully:DEMOSPDN network is external, so Docker Compose will not remove it — other services sharing the network will not be affected.
Full Deployment Sequence
Prepare configuration files
Copy the environment template and fill in your values:Ensure
endpoints.json is present in the project root with all provider credentials populated. See Configuration for the required schema.Build and start the service
api container in the background.