deploy(backend): add prod Dockerfiles, compose stack, nginx configs, deploy scripts

Multi-stage Dockerfiles for accounts-service/configs-service/gateway, a
docker-compose.prod.yml wiring fresh Postgres+MinIO+the three services on a
private network, nginx site templates for visual.loki-code.dev (static SPA +
/api proxy) and bekend.loki-code.dev (full gateway proxy for the mod), and
idempotent setup.sh/deploy.sh scripts for the VDS.

Claude-Session: https://claude.ai/code/session_01F1M1Jic1wTSn4igUENynmZ
This commit is contained in:
loki5512344 2026-09-28 14:47:53 +02:00
parent 484adaaf52
commit 2735a1c161
Signed by: boba
GPG key ID: 253067914055423B
9 changed files with 263 additions and 0 deletions

29
backend/deploy/deploy.sh Executable file
View file

@ -0,0 +1,29 @@
#!/bin/bash
# Idempotent redeploy for LoVisual. Run as: /opt/lovisual/deploy.sh
set -euo pipefail
REPO_DIR=/opt/lovisual
FRONTEND_ROOT=/var/www/visual.loki-code.dev/html
cd "$REPO_DIR"
git pull --ff-only
echo "==> Building & (re)starting backend services"
cd "$REPO_DIR/backend"
docker compose -f docker-compose.prod.yml up -d --build
echo "==> Building frontend"
cd "$REPO_DIR/frontend"
npm ci
npm run build
echo "==> Syncing frontend build to $FRONTEND_ROOT"
mkdir -p "$FRONTEND_ROOT"
rsync -a --delete dist/ "$FRONTEND_ROOT/"
echo "==> Reloading nginx"
nginx -t
systemctl reload nginx
echo "==> Done"
docker compose -f "$REPO_DIR/backend/docker-compose.prod.yml" ps