chore: reorder Dockerfile sections (#2189)

This commit is contained in:
Jonas L 2022-09-27 08:15:41 +02:00 committed by GitHub
parent 3ef42413d8
commit 96cc2b59f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 38 additions and 38 deletions

View File

@ -93,6 +93,44 @@ CMD ["/usr/local/bin/libretime-analyzer"]
ARG LIBRETIME_VERSION
ENV LIBRETIME_VERSION=$LIBRETIME_VERSION
#======================================================================================#
# Playout #
#======================================================================================#
FROM python-base-ffmpeg as libretime-playout
COPY tools/packages.py /tmp/packages.py
COPY playout/packages.ini /tmp/packages.ini
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
$(python3 /tmp/packages.py --format=line --exclude=python bullseye /tmp/packages.ini) \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /tmp/packages.py /tmp/packages.ini
WORKDIR /src
COPY playout/requirements.txt .
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --no-compile -r requirements.txt
COPY --from=python-builder /build/shared/*.whl .
COPY --from=python-builder /build/api-client/*.whl .
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --no-compile *.whl && rm -Rf *.whl
COPY playout .
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --editable .
# Run
USER ${UID}:${GID}
WORKDIR /app
CMD ["/usr/local/bin/libretime-playout"]
ARG LIBRETIME_VERSION
ENV LIBRETIME_VERSION=$LIBRETIME_VERSION
#======================================================================================#
# API #
#======================================================================================#
@ -133,44 +171,6 @@ CMD ["/usr/local/bin/gunicorn", \
ARG LIBRETIME_VERSION
ENV LIBRETIME_VERSION=$LIBRETIME_VERSION
#======================================================================================#
# Playout #
#======================================================================================#
FROM python-base-ffmpeg as libretime-playout
COPY tools/packages.py /tmp/packages.py
COPY playout/packages.ini /tmp/packages.ini
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
$(python3 /tmp/packages.py --format=line --exclude=python bullseye /tmp/packages.ini) \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /tmp/packages.py /tmp/packages.ini
WORKDIR /src
COPY playout/requirements.txt .
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --no-compile -r requirements.txt
COPY --from=python-builder /build/shared/*.whl .
COPY --from=python-builder /build/api-client/*.whl .
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --no-compile *.whl && rm -Rf *.whl
COPY playout .
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --editable .
# Run
USER ${UID}:${GID}
WORKDIR /app
CMD ["/usr/local/bin/libretime-playout"]
ARG LIBRETIME_VERSION
ENV LIBRETIME_VERSION=$LIBRETIME_VERSION
#======================================================================================#
# Worker #
#======================================================================================#