feat(betrieb): Docker Compose und LXC-Installer
Ein Laufzeit-Paket (scripts/paket-bauen.sh) für beide Wege: Next standalone, worker als Bundle mit nur den nötigen Paketen, Migrationen ohne Prisma-CLI. Compose lokal komplett hochgefahren; der Installer auf pve-demo in einem echten Debian-13-LXC durchgelaufen. Closes #019 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
# ProxDeploy im Betrieb: postgres, migrate (einmalig), app, worker.
|
||||
#
|
||||
# cp .env.example .env # Schlüssel erzeugen, ADMIN_PASSWORT und APP_URL setzen
|
||||
# docker compose up -d --build
|
||||
#
|
||||
# Die app lauscht auf 127.0.0.1:3000 – davor gehört ein Reverse-Proxy mit TLS (TRUST_PROXY=true).
|
||||
|
||||
name: proxdeploy
|
||||
|
||||
x-proxdeploy: &proxdeploy
|
||||
image: proxdeploy:${PROXDEPLOY_VERSION:-latest}
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
VERSION: ${PROXDEPLOY_VERSION:-}
|
||||
env_file: ${PROXDEPLOY_ENV_DATEI:-.env}
|
||||
environment:
|
||||
DATABASE_URL: postgresql://proxdeploy:${POSTGRES_PASSWORT:?POSTGRES_PASSWORT in .env setzen}@postgres:5432/proxdeploy
|
||||
restart: unless-stopped
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17.11-trixie
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: proxdeploy
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORT:?POSTGRES_PASSWORT in .env setzen}
|
||||
POSTGRES_DB: proxdeploy
|
||||
volumes:
|
||||
- datenbank:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U proxdeploy"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 20
|
||||
|
||||
migrate:
|
||||
<<: *proxdeploy
|
||||
command: ["node", "../worker/migrieren.mjs"]
|
||||
restart: "no"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
|
||||
app:
|
||||
<<: *proxdeploy
|
||||
ports:
|
||||
- "${PROXDEPLOY_BIND:-127.0.0.1}:${PROXDEPLOY_PORT:-3000}:3000"
|
||||
depends_on:
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
|
||||
worker:
|
||||
<<: *proxdeploy
|
||||
command: ["node", "../worker/worker.mjs"]
|
||||
healthcheck:
|
||||
disable: true
|
||||
# Lange Aufträge (Template-Bau) dürfen beim Stoppen zu Ende laufen.
|
||||
stop_grace_period: 40s
|
||||
depends_on:
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
|
||||
volumes:
|
||||
datenbank:
|
||||
Reference in New Issue
Block a user