PrintHeritage bundles every component it needs into a Docker Compose file at the repository root. A singleDocumentation 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 up command provisions a PostgreSQL 15 database, the FastAPI auth service, and the React front-end, wiring them together through a shared virtual network. This page explains each service, the environment variables that control runtime behaviour, and how to keep your deployment secure and maintainable.
Services
Thedocker-compose.yml file defines three services. They start in dependency order: db-auth first, then auth-service, then front-end.
db-auth — PostgreSQL database
Runs the officialpostgres:15-alpine image. It stores all user accounts, project records, permissions, and audit logs in a named volume so data survives container restarts.
auth-service — FastAPI API
Built from./auth-service using the local Dockerfile. It connects to db-auth, creates the schema on startup via SQLAlchemy, and seeds the default super-admin account if it does not already exist.
./auth-service:/app bind mount means code changes on the host are immediately reflected inside the container — useful during development without needing to rebuild.
front-end — React application
Built from./front-end. The REACT_APP_API_URL environment variable is injected at build time and tells the Axios client where to find the auth service.
Exposed ports
| Service | Host port | Container port | Purpose |
|---|---|---|---|
db-auth | 5432 | 5432 | PostgreSQL (direct access) |
auth-service | 8001 | 8000 | FastAPI REST API |
front-end | 3000 | 3000 | React development server |
In a production deployment behind a reverse proxy (e.g. Nginx or Caddy), you should remove the host-side port binding for
db-auth (5432:5432) so the database is not reachable from outside the Docker network.Environment variables
auth-service
| Variable | Default value | Description |
|---|---|---|
DATABASE_URL | postgresql://auth_user:auth_password@db-auth:5432/auth_db | Full SQLAlchemy connection string for the PostgreSQL instance. |
SECRET_KEY | CHAVE_MUITO_SECRETA_PARA_PRODUCAO | Secret used to sign and verify HS256 JWT tokens. Must be changed. |
SECRET_KEY with:
front-end
| Variable | Default value | Description |
|---|---|---|
REACT_APP_API_URL | http://localhost:8001 | Base URL the React app uses for all API requests. Update this to your public API hostname in production. |
db-auth
| Variable | Default value | Description |
|---|---|---|
POSTGRES_USER | auth_user | PostgreSQL superuser name for the auth_db database. |
POSTGRES_PASSWORD | auth_password | Password for auth_user. Change before production use. |
POSTGRES_DB | auth_db | Name of the database created on first start. |
Volume
A single named volume handles database persistence:auth_db_data is mounted at /var/lib/postgresql/data inside the db-auth container. All tables, rows, and indexes survive docker compose down and are reused when the stack is started again. To wipe all data and start fresh, run:
Startup sequence
Thedepends_on directives enforce the following startup order:
- db-auth starts first and initialises the
auth_dbdatabase. - auth-service waits for
db-auth, then callsBase.metadata.create_all()to create tables and seeds thesuper@print.comsuper-admin account if it does not exist. - front-end waits for
auth-servicebefore starting the React development server.
Docker Compose’s
depends_on only waits for the container to start, not for the service inside it to become ready. If auth-service crashes because PostgreSQL hasn’t finished initialising yet, Docker’s restart: always policy will restart it automatically until the database accepts connections.Rebuilding after code changes
The./auth-service and ./front-end/src directories are bind-mounted into their containers, so Python and React source file edits are picked up at runtime without a rebuild. However, changes to requirements.txt, package.json, or either Dockerfile require a full rebuild: