feat(deploy): Docker-Abbild, Compose, LXC-Installer und Sicherung (#014)
Mehrstufiges Abbild mit Standalone-Ausgabe, eigener Migrationsdienst, Worker als ESM-Buendel, LXC-Installer fuer Proxmox, Reverse-Proxy-Beispiele, Sicherungsskript und Zustandspruefung. Stapel gebaut und mit Agent-Durchlauf geprueft. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
# ProxLedger – vollständige Installation mit Dashboard, Worker und Datenbank.
|
||||
# 1. cp .env.example .env und Werte eintragen (mindestens APP_SECRET, POSTGRES_PASSWORD, ADMIN_*, APP_URL)
|
||||
# 2. docker compose up -d
|
||||
# Migrationen und der erste Administrator entstehen dabei automatisch im Dienst „migrate“.
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER:-proxledger}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD fehlt in der .env}
|
||||
POSTGRES_DB: ${POSTGRES_DB:-proxledger}
|
||||
volumes:
|
||||
- datenbank:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-proxledger}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
# Läuft einmal beim Start: Schema einspielen und Administrator anlegen.
|
||||
migrate:
|
||||
build:
|
||||
context: .
|
||||
target: bauen
|
||||
restart: "no"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
command: ["sh", "-c", "npx prisma migrate deploy && npx prisma db seed"]
|
||||
environment:
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER:-proxledger}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-proxledger}?schema=public
|
||||
ADMIN_EMAIL: ${ADMIN_EMAIL:-admin@example.de}
|
||||
ADMIN_NAME: ${ADMIN_NAME:-Administrator}
|
||||
ADMIN_PASSWORD: ${ADMIN_PASSWORD:-}
|
||||
SEED_DEMO: ${SEED_DEMO:-0}
|
||||
|
||||
web:
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
environment:
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER:-proxledger}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-proxledger}?schema=public
|
||||
APP_SECRET: ${APP_SECRET:?APP_SECRET fehlt in der .env}
|
||||
APP_URL: ${APP_URL:-http://localhost:3000}
|
||||
ADMIN_EMAIL: ${ADMIN_EMAIL:-admin@example.de}
|
||||
ADMIN_NAME: ${ADMIN_NAME:-Administrator}
|
||||
ADMIN_PASSWORD: ${ADMIN_PASSWORD:-}
|
||||
OIDC_ISSUER: ${OIDC_ISSUER:-}
|
||||
OIDC_CLIENT_ID: ${OIDC_CLIENT_ID:-}
|
||||
OIDC_CLIENT_SECRET: ${OIDC_CLIENT_SECRET:-}
|
||||
OIDC_NAME: ${OIDC_NAME:-authentik}
|
||||
ports:
|
||||
- "${PORT:-3000}:3000"
|
||||
volumes:
|
||||
- uploads:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO-", "http://localhost:3000/api/gesundheit"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 20s
|
||||
|
||||
worker:
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
command: ["./start.sh", "worker"]
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
environment:
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER:-proxledger}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-proxledger}?schema=public
|
||||
APP_SECRET: ${APP_SECRET}
|
||||
APP_URL: ${APP_URL:-http://localhost:3000}
|
||||
WORKER_CRON: ${WORKER_CRON:-0 * * * *}
|
||||
ZUSAMMENFASSUNG_CRON: ${ZUSAMMENFASSUNG_CRON:-0 7 * * *}
|
||||
volumes:
|
||||
- uploads:/data
|
||||
|
||||
volumes:
|
||||
datenbank:
|
||||
uploads:
|
||||
Reference in New Issue
Block a user