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>
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends imagemagick \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY pyproject.toml .
|
||||
COPY gallery/ gallery/
|
||||
COPY tests/ tests/
|
||||
COPY deploy/entrypoint.sh deploy/entrypoint.sh
|
||||
|
||||
RUN pip install --no-cache-dir ".[dev]"
|
||||
|
||||
RUN useradd -r -s /bin/false gallery
|
||||
USER gallery
|
||||
|
||||
ENTRYPOINT ["gallery"]
|
||||
CMD ["generate"]
|
||||
Reference in New Issue
Block a user