Docker Compose is the easiest way to start a local PostgreSQL instance for PitchPro development. With a single command you get a fully configured, health-checked database that automatically persists data across restarts — no manual PostgreSQL installation required.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanSerna14/Final-lenguaje-Avanzado/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- Docker Desktop (macOS / Windows) or Docker Engine (Linux) — v24+
- Docker Compose v2 — bundled with Docker Desktop; on Linux install the
docker-compose-pluginpackage
Starting PostgreSQL
Navigate to the backend directory
All Docker Compose commands must be run from the
arquimarket/ folder, where docker-compose.yml lives.Ensure your .env file exists
Docker Compose reads the database credentials from your A minimal working
.env file at startup. The file must define DB_NAME, DB_USER, and DB_PASSWORD. Copy the example if you haven’t already:.env:The
DB_HOST and DB_PORT values are used by the Node.js app to connect to the database. Docker Compose itself reads DB_NAME, DB_USER, and DB_PASSWORD to initialise the container.Start the PostgreSQL container
Launch the container in detached (background) mode:Docker will pull
postgres:16-alpine on first run (≈ 80 MB), create the pgdata volume, and start the container.Verify the container is healthy
Run the status check and confirm the Expected output:If the status shows
postgres service shows (healthy):(health: starting), wait 10–15 seconds and run docker compose ps again.docker-compose.yml Explained
The full contents ofarquimarket/docker-compose.yml:
| Field | Value | Purpose |
|---|---|---|
image | postgres:16-alpine | Uses the official PostgreSQL 16 image built on Alpine Linux — small footprint (~80 MB), security-hardened |
ports | 5432:5432 | Maps the container’s PostgreSQL port to localhost:5432 so the Node.js app (and tools like pgAdmin) can connect |
environment.POSTGRES_DB | ${DB_NAME} | Reads the database name from your .env file at container start |
environment.POSTGRES_USER | ${DB_USER} | Reads the superuser username from your .env file |
environment.POSTGRES_PASSWORD | ${DB_PASSWORD} | Reads the password from your .env file — never hard-coded |
volumes | pgdata:/var/lib/postgresql/data | Mounts a named Docker volume so data survives container restarts and docker compose down (without -v) |
healthcheck.test | pg_isready -U $$POSTGRES_USER | Runs PostgreSQL’s built-in readiness probe inside the container. The $$ escapes the $ so Docker Compose doesn’t interpolate it as a host variable |
healthcheck.interval | 10s | Probes every 10 seconds |
healthcheck.timeout | 5s | Fails the probe if no response within 5 seconds |
healthcheck.retries | 5 | Marks the container unhealthy after 5 consecutive failures |
Useful Docker Commands
Use
docker compose down -v when you want a completely fresh database — for example, after changing the schema seed or rotating credentials. All table data and the pgdata volume will be permanently deleted.Connecting Without Docker
If you already have a local PostgreSQL installation (v14 or later), you can skip Docker entirely. PitchPro’s backend uses thepg Node.js library (pg.Pool) and connects to any compatible PostgreSQL server using the DB_* environment variables.
Simply set the variables in arquimarket/.env to point at your existing instance:
initDatabase() function will automatically create all required tables on first startup — no manual migrations needed.
Production Notes
Environment Variables
Reference for all backend and frontend
.env variables, including JWT secrets and database credentials.Backend Setup
Install dependencies, run database migrations, and start the Express API locally.
Database
Schema overview, table definitions, and the
initDatabase() auto-migration system.Frontend Setup
Configure and run the Vite + React frontend, including
VITE_HOST_API pointing to the backend.