feat: ADD 'new' function to generate new instance to avoid git clone #1

This commit is contained in:
Caffeine Fueled 2026-07-04 08:54:05 +02:00
parent 8e91571121
commit 0cbd56b689
Signed by: cf7
GPG key ID: CA295D643074C68C
2 changed files with 119 additions and 13 deletions

View file

@ -15,6 +15,16 @@ RUN python3 -m pip install --no-cache-dir -r /tmp/requirements.txt --break-syste
# Copy Python script to /usr/local/bin so it survives volume mounts
COPY picopaper.py /usr/local/bin/picopaper.py
# Bake the default blog content into the image. The `new` command copies these
# into the working directory to scaffold a fresh blog without cloning the repo.
# Only user content is included — not picopaper.py/requirements.txt/.gitignore.
ENV PICOPAPER_SKELETON=/usr/local/share/picopaper/skeleton
COPY config.py /usr/local/share/picopaper/skeleton/
COPY theme/ /usr/local/share/picopaper/skeleton/theme/
COPY items/ /usr/local/share/picopaper/skeleton/items/
COPY images/ /usr/local/share/picopaper/skeleton/images/
COPY static/ /usr/local/share/picopaper/skeleton/static/
# Set working directory
WORKDIR /app
@ -24,5 +34,8 @@ ENV PYTHONPATH=/app
# Run as root to allow writing to mounted volumes
# (The mounted volume will have host user permissions)
# Generate the site on container start
CMD ["python3", "/usr/local/bin/picopaper.py"]
# With no command the site is generated; pass `new` to scaffold a blog instead:
# podman run ... picopaper:latest -> build the site (default)
# podman run ... picopaper:latest new -> create a new blog in the current dir
ENTRYPOINT ["python3", "/usr/local/bin/picopaper.py"]
CMD []