chore: reorder Dockerfile sections (#2189)
This commit is contained in:
parent
3ef42413d8
commit
96cc2b59f5
76
Dockerfile
76
Dockerfile
|
@ -93,6 +93,44 @@ CMD ["/usr/local/bin/libretime-analyzer"]
|
||||||
ARG LIBRETIME_VERSION
|
ARG LIBRETIME_VERSION
|
||||||
ENV LIBRETIME_VERSION=$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 #
|
# API #
|
||||||
#======================================================================================#
|
#======================================================================================#
|
||||||
|
@ -133,44 +171,6 @@ CMD ["/usr/local/bin/gunicorn", \
|
||||||
ARG LIBRETIME_VERSION
|
ARG LIBRETIME_VERSION
|
||||||
ENV LIBRETIME_VERSION=$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 #
|
# Worker #
|
||||||
#======================================================================================#
|
#======================================================================================#
|
||||||
|
|
Loading…
Reference in New Issue