invoice-system/docker-compose.yml

43 lines
1.0 KiB
YAML

services:
postgres:
image: postgres:15-alpine
container_name: quote_postgres
environment:
POSTGRES_USER: quoteuser
POSTGRES_PASSWORD: quotepass123
POSTGRES_DB: quotes_db
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/01-init.sql
- ./add_invoices.sql:/docker-entrypoint-initdb.d/02-add-invoices.sql
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U quoteuser -d quotes_db"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
app:
build: .
container_name: quote_app
ports:
- "3000:3000"
environment:
NODE_ENV: production
DB_HOST: postgres
DB_PORT: 5432
DB_USER: quoteuser
DB_PASSWORD: quotepass123
DB_NAME: quotes_db
volumes:
- ./public/uploads:/app/public/uploads
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
volumes:
postgres_data: