Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Haibersut committed Jul 31, 2023
1 parent b6c41be commit 2567630
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
FROM python:3.11.2-slim-bullseye
FROM python:3.11.2-slim-bullseye as builder

ENV DEBIAN_FRONTEND=noninteractive

COPY ./fonts/sarasa-mono-sc-regular.ttf /usr/share/fonts/

RUN apt-get update && \
apt install --no-install-recommends xvfb binutils build-essential qtbase5-dev wkhtmltopdf ffmpeg -yq && \
(strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 || true) && \
apt-get clean && \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \
rm -rf /var/lib/apt/lists/*
(strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 || true)

RUN mkdir -p /app
WORKDIR /app

COPY requirements.txt /app
RUN pip install --no-cache-dir -r requirements.txt && pip cache purge
RUN pip install --no-cache-dir -r requirements.txt

FROM python:3.11.2-slim-bullseye

COPY --from=builder /usr/share/fonts/sarasa-mono-sc-regular.ttf /usr/share/fonts/
COPY --from=builder /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 /usr/lib/x86_64-linux-gnu/
COPY --from=builder /app /app

RUN apt-get apt-get remove --purge -yq binutils build-essential qtbase5-dev
RUN apt-get remove --purge -yq binutils && \
apt-get clean && \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \
rm -rf /var/lib/apt/lists/* && \
pip cache purge

WORKDIR /app

COPY . /app

CMD ["/bin/bash", "/app/docker/start.sh"]


0 comments on commit 2567630

Please sign in to comment.