build: dockerfile, compose und readme

- Multi-Stage-Build: Node baut das Frontend, python:3.13-slim liefert aus
- Entrypoint setzt Rechte für /data, migriert und startet Uvicorn als UID 1000
- Port nur an die LAN-IP gebunden (192.168.50.123:8085)
- Healthcheck gegen /api/health, reduzierte Capabilities, Speicherlimit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dbildhauerandClaude Opus 5.5 committed 2026-10-25 11:04:33 +01:00
1 parent 99307acf7d
commit 70af4341c9
4 files changed
+196

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
#!/bin/sh
set -eu
# Starts as root only to fix ownership of the bind-mounted data directory,
# then drops to the unprivileged "app" user for migrations and the server.
if [ "$(id -u)" = "0" ]; then
mkdir -p /data/files
if [ "$(stat -c %u /data)" != "1000" ]; then
chown -R app:app /data
fi
exec setpriv --reuid=app --regid=app --init-groups "$0" "$@"
fi
cd /app
alembic upgrade head
exec uvicorn app.main:app \
--host 0.0.0.0 \
--port 8000 \
--workers 1 \
--proxy-headers \
--forwarded-allow-ips "${FORWARDED_ALLOW_IPS:-127.0.0.1}" \
--log-level "${LOG_LEVEL:-info}"