fabriquedoc/backend/Dockerfile
François Pelletier 4a6bfc951f Gros refactoring
2024-12-31 17:00:07 -05:00

52 lines
No EOL
1.2 KiB
Docker

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
EXPOSE 8000
# 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
CMD ["poetry", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]