Run Marbes Backend in Docker using provided Compose files — from a single-container dev setup to a full production stack with PostgreSQL, Redis, and Nginx.
Use this file to discover all available pages before exploring further.
Marbes Backend ships with multiple Docker Compose configurations that cover different deployment scenarios. The standard docker-compose.yml attaches the backend to pre-existing external networks shared with a frontend and database layer. The docker-compose.prod.yml spins up a self-contained production stack that includes PostgreSQL, Redis, Nginx, and an optional automated backup service. This page covers both paths and documents every environment variable the application reads.
Use this when the backend joins an existing Docker network topology — for example, when a frontend, database, and backend are each managed by separate Compose files.The backend container expects three external networks to already exist before it starts:
Network
Purpose
marbes_frontend_net
Communication with the frontend service
marbes_backend_net
Internal backend traffic
marbes_db_net
Access to the PostgreSQL database
Create the networks once before your first deploy:
The Docker health check in both the Dockerfile and docker-compose.prod.yml calls this same endpoint every 30 seconds. A container that fails three consecutive checks will be marked unhealthy.
4
Tail the logs
# Backend logs onlypnpm docker:logs# All services (prod stack)pnpm docker:logs:all
Copy env.example to .env and set the following variables. Variables marked required will cause the application to fail to start or behave incorrectly if left at their default values in production.
Expiry duration for issued tokens (note: the auth service issues tokens with a 12 h hard-coded expiry)
JWT_REFRESH_EXPIRES_IN
7d
No
Expiry duration for refresh tokens
JWT_SECRET must be a long, random string in production. Any deployment using the placeholder value from env.example is critically insecure — tokens could be forged by anyone who knows the default value.
The standard docker-compose.yml connects the backend container to three external networks. These networks must be created independently and are shared across services managed by other Compose files.
The production Compose file (docker-compose.prod.yml) uses an isolated bridge network (marbes_network_prod, subnet 172.21.0.0/16) — all services communicate internally and only Nginx exposes ports 80 and 443 to the host.