refactor: imporved layer caching for dockerfile

using existing built image for account 2
This commit is contained in:
2026-05-21 22:12:33 +02:00
parent a699ceb935
commit cd0ce06246
4 changed files with 29 additions and 12 deletions
+16 -8
View File
@@ -1,10 +1,18 @@
FROM python:3.11
FROM python:3.11-slim
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
git wget ffmpeg mediainfo && \
rm -rf /var/lib/apt/lists/*
COPY requirements.txt /app/
RUN python -m pip install --no-cache-dir --upgrade pip && \
python -m pip install --no-cache-dir -r /app/requirements.txt
COPY . /app
RUN apt-get -qq update && apt-get -qq install -y git wget ffmpeg mediainfo\
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN python -m venv --copies /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN pip install --no-cache-dir -r requirements.txt
CMD ["python", "main.py"]
ENV PYTHONUNBUFFERED=1
CMD ["python", "-u", "main.py"]