feat(docker): Remove exiftool dependency, update deps

This commit is contained in:
TheOnlyWayUp
2025-10-28 16:44:45 +05:30
parent 9755c62ee8
commit 3eca87e7cf
3 changed files with 969 additions and 539 deletions
+6 -18
View File
@@ -13,23 +13,14 @@ FROM python:3.13-slim
WORKDIR /app
# Install apt-fast, git, exiftool
COPY --from=nobodyxu/apt-fast:latest-debian-buster-slim /usr/local/ /usr/local/
RUN apt update
RUN apt install -y aria2
RUN apt-fast install -y git build-essential libpango-1.0-0 libpangoft2-1.0-0 wget
RUN apt-fast install -y git build-essential python3.13-dev libgobject-2.0 libpango-1.0 libpangoft2-1.0
# aiohttp-client-cache depends on multipart, which requires python3.13-dev to build successfully on 3.13
# weasyprint depends on libgoject, libpango, and libpangoft2
ENV EXIFTOOL_VERSION="13.06"
RUN wget "https://exiftool.org/Image-ExifTool-${EXIFTOOL_VERSION}.tar.gz"
RUN gzip -dc "Image-ExifTool-${EXIFTOOL_VERSION}.tar.gz" | tar -xf -
WORKDIR /app/Image-ExifTool-${EXIFTOOL_VERSION}
RUN perl Makefile.PL
RUN make test
RUN make install
RUN rm -rf /var/lib/apt/lists/* /app/Image-ExifTool-${EXIFTOOL_VERSION}
WORKDIR /app
@@ -37,17 +28,14 @@ WORKDIR /app
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
COPY src/api/requirements.txt requirements.txt
COPY src/api/src/create_book/generators/pdf/exiftool.config exiftool.config
RUN uv pip install -r requirements.txt --system
COPY src/api/ /app
RUN uv sync
COPY --from=0 /build/build /app/src/build
COPY src/api/src src
# Is this still needed?
RUN ln -s /app/src/pdf/fonts /tmp/fonts
WORKDIR /app/src
EXPOSE 80
CMD [ "python3", "main.py"]
CMD [ "uv", "run", "main.py"]