TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/joaomonteir0/printheritage/llms.txt
Use this file to discover all available pages before exploring further.
docker-compose.yml at the root of the PrintHeritage repository orchestrates three cooperating services — a PostgreSQL 15 database, a FastAPI authentication backend, and a React front-end — on a shared Docker network. This page documents every service definition, explains the port mappings and volume mounts, and provides the common commands needed to operate the stack locally and in CI.
Architecture Overview
db-auth
PostgreSQL 15 (Alpine). Stores user accounts and project permissions. Accessible only within the Docker network in production; port
5432 is forwarded to the host for local development convenience.auth-service
FastAPI application served by Uvicorn on internal port
8000, mapped to host port 8001. Handles registration, login, JWT issuance, and role-based access control.front-end
Create React App development server on port
3000. Communicates exclusively with auth-service via REACT_APP_API_URL. Source files are hot-reloaded through a bind mount.depends_on, though it does not wait for a service to be healthy — only for its container to start. The auth service therefore implements its own retry loop (up to 5 retries, 3-second delay) when connecting to PostgreSQL.
Full docker-compose.yml
Service Reference
db-auth
Thedb-auth service provides the persistent relational store for all authentication data.
| Property | Value |
|---|---|
| Image | postgres:15-alpine |
| Container name | auth-db-postgres |
| Restart policy | always |
| Host → container port | 5432 → 5432 |
| Volume | auth_db_data:/var/lib/postgresql/data (named volume) |
POSTGRES_* environment variables seed the database on first run. Once the auth_db_data volume exists these values are ignored by PostgreSQL itself — the data directory is already initialised. To apply new credentials to an existing installation you must alter them inside the running database and then update docker-compose.yml to match.
The named volume
auth_db_data is declared at the top level of docker-compose.yml under volumes:. Docker Compose creates it automatically the first time the stack is brought up. Removing it with docker compose down -v permanently deletes all stored user data.auth-service
Theauth-service is the Python backend, built from ./auth-service/Dockerfile which uses python:3.11-slim as its base image.
| Property | Value |
|---|---|
| Build context | ./auth-service |
| Container name | auth-service-api |
| Restart policy | always |
| Host → container port | 8001 → 8000 |
| Depends on | db-auth |
| Bind mount | ./auth-service:/app |
8000 (as declared by EXPOSE 8000 and CMD uvicorn main:app --port 8000 in the Dockerfile). Docker maps this to host port 8001 so the API is reachable at http://localhost:8001 without conflicting with any other service that might occupy port 8000 on the host.
The bind mount ./auth-service:/app overlays the entire source directory onto the container’s working directory. This means any Python file edit on the host is immediately reflected inside the container, enabling Uvicorn’s auto-reload in development without a rebuild.
front-end
Thefront-end service is a Create React App development server, built from ./front-end/Dockerfile using node:20-slim.
| Property | Value |
|---|---|
| Build context | ./front-end |
| Container name | front-end-react |
| Restart policy | always |
| Host → container port | 3000 → 3000 |
| Depends on | auth-service |
| Bind mount | ./front-end/src:/app/src |
ENV WDS_SOCKET_PORT=0 to resolve WebSocket HMR (Hot Module Replacement) connectivity issues that arise in some Docker networking environments.
Named Volumes
| Volume | Mounted in | Container path | Purpose |
|---|---|---|---|
auth_db_data | db-auth | /var/lib/postgresql/data | Persists the PostgreSQL data directory across container restarts and recreations. Without this volume, all user and permission data would be lost every time the db-auth container is stopped. |
Common Commands
Start all services (with build)
Run this command from the repository root the first time you bring up the stack, or after any change to a Logs from all three services stream to your terminal. Press
Dockerfile or requirements.txt / package.json.Ctrl + C to stop.Start detached (background)
Starts all services in the background and returns control to your shell immediately.Use
docker compose ps to confirm all containers are in the running state.Stop all services
Stops and removes containers and the default network, but preserves the
auth_db_data volume and your local source files.Stop and remove all data
Stops containers and deletes all named volumes, including
auth_db_data. All stored users and permissions are permanently erased. Use with caution.Dependency Graph
front-end → auth-service → db-auth), ensuring clean disconnection at every layer.