Files
lars 8cae6533d5 Replace Singularity with Docker; add production deployment setup
- Remove Singularity.def; add Dockerfile (python:3.11-slim + ImageMagick,
  non-root user, installs gallery package with dev extras)
- Add .dockerignore to keep image lean
- Rewrite .gitlab-ci.yml: build→test→publish stages using Docker-in-Docker;
  push per-commit SHA tag and promote to :latest on main
- Add docker-compose.yml: gallery-generator + nginx services sharing a
  named volume; configurable GENERATE_INTERVAL env var
- Add deploy/nginx.conf: gzip, security headers, correct caching policy
  (immutable for assets, no-store for HTML)
- Add deploy/entrypoint.sh: runs gallery generate on startup then loops
  on GENERATE_INTERVAL; exits cleanly when interval is 0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 11:48:04 +02:00

27 lines
551 B
Bash
Executable File

#!/bin/sh
set -e
CONFIG_FILE="${CONFIG_FILE:-/config/config.yaml}"
GENERATE_INTERVAL="${GENERATE_INTERVAL:-300}" # seconds between regenerations; 0 = run once and exit
if [ ! -f "$CONFIG_FILE" ]; then
echo "ERROR: config file not found at $CONFIG_FILE" >&2
exit 1
fi
run_generate() {
echo "[$(date -u +%FT%TZ)] Running gallery generate..."
gallery --config "$CONFIG_FILE" generate --verbose
}
run_generate
if [ "$GENERATE_INTERVAL" -eq 0 ]; then
exit 0
fi
while true; do
sleep "$GENERATE_INTERVAL"
run_generate
done