Docker Compose is the fastest way to run the entire Clinica stack on your machine. A single command builds and starts all three services — the Node.js API, the React frontend, and the PostgreSQL database — with no manual configuration required.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/bentlyy/Clinica/llms.txt
Use this file to discover all available pages before exploring further.
Services
Clinica’sdocker-compose.yml defines three services:
| Service | Image / Build | Port | Description |
|---|---|---|---|
api | ./dockerfile | 3000 | Node.js REST API (Express) |
frontend | ./frontend/Dockerfile | 5173 | React app served by Vite |
db | postgres:15 | — | PostgreSQL 15 database |
frontend service depends on api, and api depends on db. Docker Compose starts services in dependency order automatically.
docker-compose.yml
docker-compose.yml
Starting the stack
Configure environment variables
The repository ships with a See the environment variables reference for all available options.
.env file containing working defaults for Docker Compose. Open it and update jwt_secret and the email credentials before starting.Build and start all services
Run the following command from the repository root. The On first run, Docker pulls the
--build flag rebuilds images when source files have changed.postgres:15 image, builds the api and frontend images, and initialises the database schema. This takes a minute or two.Verify the services are running
Once all containers are healthy, open the following URLs in your browser:
- Frontend — http://localhost:5173
- API health check — http://localhost:3000/health
Database initialisation
When thedb container starts for the first time, PostgreSQL automatically runs every SQL file mounted into /docker-entrypoint-initdb.d/. Clinica mounts db/init.sql at that path, which creates the following tables:
| Table | Purpose |
|---|---|
users | Authentication accounts with roles |
doctors | Doctor profiles linked to user accounts |
bookings | Appointment records with reminder tracking |
doctor_availability | Weekly availability windows per doctor |
doctor_exceptions | One-off blocked dates or time ranges |
The init script runs only once — when the
db_data volume is first created. If you change db/init.sql after the volume already exists, you need to reset the database for the changes to take effect.Volumes
| Volume | Mounted at | Purpose |
|---|---|---|
db_data | /var/lib/postgresql/data | Persists PostgreSQL data across restarts |
. (bind) | /app (api container) | Live-reloads API source changes |
./frontend (bind) | /app (frontend container) | Live-reloads frontend source changes |
db_data named volume ensures your data survives docker compose down. Only docker compose down -v removes it.
Port mappings
| Host port | Container port | Service |
|---|---|---|
| 3000 | 3000 | api |
| 5173 | 5173 | frontend |
db service does not expose a host port by default. The API connects to it over the internal Docker network using the hostname db.
Health check
The API exposes a health check endpoint. Use it to confirm the service is reachable before sending other requests.Stopping the stack
To stop all containers without removing data:Resetting the database
To stop all containers and delete all persisted data (including thedb_data volume):