42 lines
1.1 KiB
Docker
42 lines
1.1 KiB
Docker
FROM python:3.11-slim AS base
|
|
|
|
# Install Scribus and dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
scribus \
|
|
scribus-data \
|
|
xvfb \
|
|
fonts-liberation \
|
|
fonts-dejavu \
|
|
fonts-noto \
|
|
fonts-noto-color-emoji \
|
|
imagemagick \
|
|
ghostscript \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Python dependencies
|
|
COPY requirements.txt /app/requirements.txt
|
|
RUN pip install --no-cache-dir -r /app/requirements.txt
|
|
|
|
# Copy application code
|
|
COPY server/ /app/server/
|
|
COPY scripts/ /app/scripts/
|
|
|
|
WORKDIR /app
|
|
|
|
# Create directories
|
|
RUN mkdir -p /app/templates /app/output /app/jobs
|
|
|
|
# Allow ImageMagick to process PDFs (needed for thumbnails)
|
|
RUN if [ -f /etc/ImageMagick-6/policy.xml ]; then \
|
|
sed -i 's/rights="none" pattern="PDF"/rights="read|write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml; \
|
|
fi
|
|
|
|
ENV SCRIBUS_PATH=/usr/bin/scribus
|
|
EXPOSE 8080
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
|
|
CMD curl -f http://localhost:8080/health || exit 1
|
|
|
|
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "8080"]
|