Files
TicketingSystem/docker-compose.yml
T
2026-04-18 16:42:47 -04:00

71 lines
1.7 KiB
YAML

# TicketingSystem — Production
# Copy this file + .env to your server, then:
# docker compose pull && docker compose up -d
# First deploy only:
# docker compose exec server npm run db:seed
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ticketing
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 5s
timeout: 5s
retries: 5
networks:
- internal
server:
image: ${REGISTRY}/josh/ticketing-server:${TAG:-latest}
restart: unless-stopped
environment:
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/ticketing
JWT_SECRET: ${JWT_SECRET}
CLIENT_URL: ${CLIENT_URL}
PORT: 3000
UPLOADS_DIR: /data/uploads
SMTP_HOST: ${SMTP_HOST:-}
SMTP_PORT: ${SMTP_PORT:-587}
SMTP_USER: ${SMTP_USER:-}
SMTP_PASS: ${SMTP_PASS:-}
SMTP_FROM: ${SMTP_FROM:-noreply@localhost}
SMTP_SECURE: ${SMTP_SECURE:-false}
volumes:
- uploads:/data/uploads
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ['CMD-SHELL', 'wget -qO- http://localhost:3000/healthz || exit 1']
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
networks:
- internal
client:
image: ${REGISTRY}/josh/ticketing-client:${TAG:-latest}
restart: unless-stopped
ports:
- '${PORT:-3080}:80'
depends_on:
- server
networks:
- internal
networks:
internal:
driver: bridge
volumes:
postgres_data:
uploads: