2024-12-31 22:00:07 +00:00
|
|
|
FROM python:3.13-slim
|
|
|
|
|
|
|
|
# Install system dependencies
|
|
|
|
RUN apt-get -y update && apt-get install -y \
|
|
|
|
pandoc \
|
|
|
|
imagemagick \
|
|
|
|
lmodern \
|
|
|
|
texlive-latex-recommended \
|
|
|
|
texlive-fonts-recommended \
|
|
|
|
texlive-lang-french \
|
|
|
|
texlive-luatex \
|
|
|
|
texlive-latex-extra \
|
|
|
|
texlive-fonts-extra \
|
|
|
|
curl \
|
|
|
|
build-essential \
|
|
|
|
gcc \
|
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
# Install Poetry
|
|
|
|
RUN curl -sSL https://install.python-poetry.org | python3 -
|
|
|
|
|
|
|
|
# Add Poetry to PATH
|
|
|
|
ENV PATH="/root/.local/bin:$PATH"
|
|
|
|
|
|
|
|
# Set the working directory
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
# Copy only pyproject.toml and poetry.lock (if it exists)
|
|
|
|
COPY pyproject.toml poetry.lock* ./
|
|
|
|
|
|
|
|
# Install project dependencies
|
|
|
|
RUN poetry config virtualenvs.create false \
|
|
|
|
&& poetry install --no-interaction --no-ansi
|
|
|
|
|
|
|
|
# Policy for ImageMagick
|
|
|
|
COPY conf/policy.xml /etc/ImageMagick-6/policy.xml
|
|
|
|
|
|
|
|
# Expose the application port
|
2025-01-01 02:01:12 +00:00
|
|
|
EXPOSE 8080
|
2024-12-31 22:00:07 +00:00
|
|
|
|
|
|
|
# Copy the application code
|
|
|
|
COPY conf ./conf
|
|
|
|
COPY font ./font
|
|
|
|
COPY resources ./resources
|
|
|
|
COPY styles ./styles
|
|
|
|
COPY routers ./routers
|
|
|
|
COPY *.py .
|
|
|
|
COPY *.lua .
|
|
|
|
|
|
|
|
# Run the application
|
2025-01-01 02:01:12 +00:00
|
|
|
CMD ["poetry", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]
|