69 lines
1.7 KiB
YAML
69 lines
1.7 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_DB: kooltap
|
|
POSTGRES_USER: kooltap
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-changeme}
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U kooltap"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- kooltap-net
|
|
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: api
|
|
ports:
|
|
- "${API_PORT:-3001}:3001"
|
|
environment:
|
|
DATABASE_URL: "postgresql://kooltap:${DB_PASSWORD:-changeme}@postgres:5432/kooltap"
|
|
JWT_SECRET: "${JWT_SECRET}"
|
|
JWT_REFRESH_SECRET: "${JWT_REFRESH_SECRET}"
|
|
PORT: 3001
|
|
CORS_ORIGIN: "${DASHBOARD_URL:-http://localhost:3000}"
|
|
RESEND_API_KEY: "${RESEND_API_KEY:-}"
|
|
RESEND_FROM_EMAIL: "${RESEND_FROM_EMAIL:-KoolTap <onboarding@resend.dev>}"
|
|
# The API sits behind a reverse proxy: trust one hop of X-Forwarded-For for per-client rate limiting
|
|
TRUST_PROXY: "${TRUST_PROXY:-1}"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
networks:
|
|
- kooltap-net
|
|
- scoobydoo
|
|
|
|
dashboard:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: dashboard
|
|
args:
|
|
NEXT_PUBLIC_API_URL: "${API_URL:-http://localhost:3001}/api/v1"
|
|
NEXT_PUBLIC_SITE_URL: "${DASHBOARD_URL:-https://kooltap.com}"
|
|
ports:
|
|
- "${DASHBOARD_PORT:-3000}:3000"
|
|
depends_on:
|
|
- api
|
|
restart: unless-stopped
|
|
networks:
|
|
- kooltap-net
|
|
- scoobydoo
|
|
|
|
volumes:
|
|
pgdata:
|
|
|
|
networks:
|
|
kooltap-net:
|
|
driver: bridge
|
|
scoobydoo:
|
|
external: true |