99 lines
2.5 KiB
YAML
99 lines
2.5 KiB
YAML
name: timesheet
|
|
|
|
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
container_name: timesheet-db
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: coastal
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:?DB_PASSWORD must be set in .env}
|
|
POSTGRES_DB: coastal_timesheet
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ['CMD-SHELL', 'pg_isready -U coastal -d coastal_timesheet']
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 10s
|
|
networks:
|
|
- coastal
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 256M
|
|
|
|
backend:
|
|
build:
|
|
context: ../
|
|
dockerfile: docker/backend/Dockerfile
|
|
container_name: timesheet-backend
|
|
restart: unless-stopped
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
DATABASE_URL: postgresql://coastal:${DB_PASSWORD:?DB_PASSWORD must be set}@db:5432/coastal_timesheet
|
|
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET must be set in .env}
|
|
JWT_REFRESH_SECRET: ${JWT_REFRESH_SECRET:?JWT_REFRESH_SECRET must be set in .env}
|
|
PORT: '3004'
|
|
NODE_ENV: production
|
|
CORS_ORIGINS: https://ts.bizzle.cloud,http://localhost:5173,http://localhost:3000
|
|
SMTP_HOST: ${SMTP_HOST:-}
|
|
SMTP_PORT: ${SMTP_PORT:-587}
|
|
SMTP_USER: ${SMTP_USER:-}
|
|
SMTP_PASS: ${SMTP_PASS:-}
|
|
SMTP_FROM: ${SMTP_FROM:-}
|
|
ADMIN_EMAIL: ${ADMIN_EMAIL:-bizzle@coastalcontracting.com}
|
|
ports:
|
|
- '127.0.0.1:3005:3004'
|
|
healthcheck:
|
|
test: ['CMD', 'node', '-e', "fetch('http://localhost:3004/api/health').then(r=>{if(!r.ok)throw 1}).catch(()=>process.exit(1))"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 30s
|
|
networks:
|
|
- coastal
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 256M
|
|
|
|
frontend:
|
|
build:
|
|
context: ../
|
|
dockerfile: docker/frontend/Dockerfile
|
|
container_name: timesheet-frontend
|
|
restart: unless-stopped
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
ports:
|
|
- '127.0.0.1:8083:80'
|
|
- '172.18.0.1:8083:80'
|
|
volumes:
|
|
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
|
healthcheck:
|
|
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:80/']
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 10s
|
|
networks:
|
|
- coastal
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 128M
|
|
|
|
volumes:
|
|
pgdata:
|
|
external: true
|
|
name: coastal_pgdata
|
|
|
|
networks:
|
|
coastal:
|
|
driver: bridge
|