Files
kennethreitz.org/Dockerfile
T
kennethreitz 71d4db055e Add PDF generation support and improve documentation
- Add WeasyPrint dependencies to Dockerfile for server-side PDF generation
- Update README with Quick Start guide for Docker and local development
- Add PDF template for article rendering
- Add error template for better error handling
- Reorganize photography into top-12 subdirectory
- Update pyproject.toml with PDF generation dependencies
- Enhance content.py with PDF rendering capabilities
- Improve directory template with gallery features

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-01 15:17:43 -04:00

31 lines
901 B
Docker

FROM astral/uv:python3.13-bookworm
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
UV_SYSTEM_PYTHON=1
WORKDIR /app
# Install system dependencies for WeasyPrint (PDF generation)
RUN apt-get update && apt-get install -y \
libcairo2 \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libgdk-pixbuf2.0-0 \
libffi-dev \
shared-mime-info \
&& rm -rf /var/lib/apt/lists/*
# Copy dependency files and required package files
COPY pyproject.toml README.md ./
COPY tuftecms ./tuftecms
# Install dependencies directly without creating a venv (since we're in a container)
RUN uv pip install . --system
# Copy the rest of the application
COPY . .
# Run gunicorn directly (no need for uv run since we installed system-wide)
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "--worker-class", "gevent", "--workers", "1", "--worker-connections", "1000", "--timeout", "60", "engine:app"]