From fff5bc8fd85ab7fdbb9b73b15a0eae36a8293cf0 Mon Sep 17 00:00:00 2001 From: Checker8763 <39644556+Checker8763@users.noreply.github.com> Date: Sat, 17 May 2025 19:48:31 +0200 Subject: [PATCH] Update Dockerfile - introduced build stage to make repo and dockerfile sufficient to build - fixed version to at least python3 - used the slim python image variant for size reduction --- docker/Dockerfile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 1ae078b..3152809 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,9 +1,17 @@ -FROM python +FROM python:3-slim AS builder -COPY websockify-*.tar.gz / +WORKDIR /build/websockify -RUN python3 -m pip install websockify-*.tar.gz -RUN rm -rf /websockify-* /root/.cache +COPY ./* /build/websockify + +RUN pip3 install setuptools && \ + python3 setup.py sdist --dist-dir docker/ + +# Actual final image +FROM python:3-slim +COPY --from=builder /build/websockify/websockify-*.tar.gz / +RUN python3 -m pip install websockify-*.tar.gz && \ + rm -rf /websockify-* /root/.cache VOLUME /data