| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- version: "3.9"
- # ─────────────────────────────────────────────────────────────────────────────
- # PMDI – Pay My Damn Invoice
- # Multi-container Docker Compose orchestration
- # ─────────────────────────────────────────────────────────────────────────────
- services:
- # ── PostgreSQL 15 ──────────────────────────────────────────────────────────
- db:
- image: postgres:15-alpine
- container_name: pmdi_db
- restart: unless-stopped
- environment:
- POSTGRES_DB: ${POSTGRES_DB:-pmdi}
- POSTGRES_USER: ${POSTGRES_USER:-pmdi}
- POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
- volumes:
- - postgres_data:/var/lib/postgresql/data
- networks:
- - pmdi_net
- healthcheck:
- test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-pmdi} -d ${POSTGRES_DB:-pmdi}"]
- interval: 10s
- timeout: 5s
- retries: 5
- start_period: 15s
- # ── FastAPI Backend ────────────────────────────────────────────────────────
- backend:
- build:
- context: ./backend
- dockerfile: Dockerfile
- container_name: pmdi_backend
- restart: unless-stopped
- env_file:
- - .env
- environment:
- # Override DATABASE_URL so it always points to the db container
- DATABASE_URL: postgresql://${POSTGRES_USER:-pmdi}:${POSTGRES_PASSWORD:-changeme}@db:5432/${POSTGRES_DB:-pmdi}
- depends_on:
- db:
- condition: service_healthy
- ports:
- - "8000:8000"
- networks:
- - pmdi_net
- # ── Vue 3 Frontend ─────────────────────────────────────────────────────────
- frontend:
- build:
- context: ./frontend
- dockerfile: Dockerfile
- container_name: pmdi_frontend
- restart: unless-stopped
- environment:
- # Vite dev-server proxy target (must resolve inside the Docker network)
- VITE_API_TARGET: http://backend:8000
- ports:
- - "3000:3000"
- networks:
- - pmdi_net
- depends_on:
- - backend
- # ─── Optional: Postfix Mail Relay ─────────────────────────────────────────
- # Uncomment the block below to start an in-network mail relay (Mode B).
- # Then add MAIL_RELAY_HOST=postfix to your .env file so the backend
- # routes outbound mail through this container.
- #
- # postfix:
- # image: boky/postfix:latest
- # container_name: pmdi_postfix
- # restart: unless-stopped
- # environment:
- # ALLOWED_SENDER_DOMAINS: "${MAIL_SENDER_DOMAIN:-example.com}"
- # # Optional: forward to an upstream relay (e.g. Gmail SMTP)
- # # RELAYHOST: "[smtp.gmail.com]:587"
- # # RELAYHOST_USERNAME: "user@gmail.com"
- # # RELAYHOST_PASSWORD: "app-password"
- # networks:
- # - pmdi_net
- # ──────────────────────────────────────────────────────────────────────────
- # ── Volumes ────────────────────────────────────────────────────────────────
- volumes:
- postgres_data:
- driver: local
- # ── Networks ───────────────────────────────────────────────────────────────
- networks:
- pmdi_net:
- driver: bridge
|