refactor: imporved layer caching for dockerfile
using existing built image for account 2
This commit is contained in:
+16
-8
@@ -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"]
|
||||
Reference in New Issue
Block a user