Initial commit: Korrith website, assessment API, PocketBase schema, Docker/Coolify deployment
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
# Korrith — production stack for Coolify / plain Docker Compose.
|
||||
#
|
||||
# Expose the `web` service (container port 80) with your domain.
|
||||
# It serves the built frontend and reverse-proxies same-origin paths:
|
||||
# /hcgi/api/* -> api:3001 (Express)
|
||||
# /hcgi/platform/* -> pocketbase:8090 (PocketBase API + admin UI at /hcgi/platform/_/)
|
||||
#
|
||||
# Required environment variables are documented in .env.example.
|
||||
|
||||
services:
|
||||
pocketbase:
|
||||
build:
|
||||
context: ./apps/pocketbase
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
PB_ENCRYPTION_KEY: ${PB_ENCRYPTION_KEY:?Set PB_ENCRYPTION_KEY (32+ random chars)}
|
||||
PB_SUPERUSER_EMAIL: ${PB_SUPERUSER_EMAIL:?Set the initial PocketBase admin email}
|
||||
PB_SUPERUSER_PASSWORD: ${PB_SUPERUSER_PASSWORD:?Set the initial PocketBase admin password}
|
||||
volumes:
|
||||
- pocketbase-data:/pb_data
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-fsS", "http://localhost:8090/api/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 12
|
||||
start_period: 10s
|
||||
|
||||
api:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/api/Dockerfile
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
PORT: 3001
|
||||
CORS_ORIGIN: ${CORS_ORIGIN:-*}
|
||||
PB_SUPERUSER_EMAIL: ${PB_SUPERUSER_EMAIL}
|
||||
PB_SUPERUSER_PASSWORD: ${PB_SUPERUSER_PASSWORD}
|
||||
SMTP_HOST: ${SMTP_HOST:?Set SMTP_HOST}
|
||||
SMTP_PORT: ${SMTP_PORT:-587}
|
||||
SMTP_USER: ${SMTP_USER:?Set SMTP_USER}
|
||||
SMTP_PASSWORD: ${SMTP_PASSWORD:?Set SMTP_PASSWORD}
|
||||
MAIL_FROM: ${MAIL_FROM:-}
|
||||
MAIL_REPLY_TO: ${MAIL_REPLY_TO:-}
|
||||
ADMIN_EMAILS: ${ADMIN_EMAILS:-}
|
||||
depends_on:
|
||||
pocketbase:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "node", "-e", "fetch('http://localhost:3001/health-check').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 20s
|
||||
|
||||
web:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/web/Dockerfile
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80" # Coolify: point your domain at this service, container port 80
|
||||
depends_on:
|
||||
- api
|
||||
- pocketbase
|
||||
|
||||
volumes:
|
||||
pocketbase-data:
|
||||
Reference in New Issue
Block a user