Postgres
This commit is contained in:
@@ -1,4 +1,23 @@
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: innungsapp-postgres
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: "${POSTGRES_DB:-innungsapp}"
|
||||
POSTGRES_USER: "${POSTGRES_USER:-innungsapp}"
|
||||
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-innungsapp}"
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- pg_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-innungsapp} -d ${POSTGRES_DB:-innungsapp}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 20s
|
||||
|
||||
admin:
|
||||
build:
|
||||
context: .
|
||||
@@ -10,11 +29,14 @@ services:
|
||||
NEXT_PUBLIC_APP_URL: "${NEXT_PUBLIC_APP_URL:-https://innungsapp.com}"
|
||||
container_name: innungsapp-admin
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "3010:3000"
|
||||
environment:
|
||||
# Database — SQLite file inside the named volume
|
||||
DATABASE_URL: "file:/app/data/prod.db"
|
||||
# Database — PostgreSQL
|
||||
DATABASE_URL: "${DATABASE_URL:-postgresql://innungsapp:innungsapp@postgres:5432/innungsapp?schema=public}"
|
||||
|
||||
# Auth — CHANGE THESE in production!
|
||||
BETTER_AUTH_SECRET: "${BETTER_AUTH_SECRET}"
|
||||
@@ -29,6 +51,10 @@ services:
|
||||
SMTP_USER: "${SMTP_USER}"
|
||||
SMTP_PASS: "${SMTP_PASS}"
|
||||
|
||||
# Superadmin seed defaults (override in .env)
|
||||
SUPERADMIN_EMAIL: "${SUPERADMIN_EMAIL:-superadmin@innungsapp.de}"
|
||||
SUPERADMIN_PASSWORD: "${SUPERADMIN_PASSWORD:-}"
|
||||
|
||||
# Public URLs
|
||||
NEXT_PUBLIC_APP_URL: "${NEXT_PUBLIC_APP_URL:-https://yourdomain.com}"
|
||||
NEXT_PUBLIC_POSTHOG_KEY: "${NEXT_PUBLIC_POSTHOG_KEY:-}"
|
||||
@@ -41,17 +67,15 @@ services:
|
||||
# Node
|
||||
NODE_ENV: "production"
|
||||
volumes:
|
||||
# SQLite database — persists across restarts
|
||||
- db_data:/app/data
|
||||
# Uploaded files — persists across restarts
|
||||
- uploads_data:/app/uploads
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO-", "http://localhost:3000/api/health"]
|
||||
test: ["CMD-SHELL", "wget -qO- http://localhost:3000/api/health | grep -q '\"status\":\"ok\"'"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
pg_data:
|
||||
uploads_data:
|
||||
|
||||
Reference in New Issue
Block a user