From 1f86cd62946d916855ab21a2c97af361189ca411 Mon Sep 17 00:00:00 2001 From: Checker8763 <39644556+Checker8763@users.noreply.github.com> Date: Sat, 17 May 2025 19:35:43 +0200 Subject: [PATCH 1/2] Update setup.py Added packages=find_packages() instead of hardcoding the packages --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5f8118fb..00b52957 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ author="Joel Martin", author_email="github@martintribe.org", - packages=['websockify'], + packages=find_packages(), include_package_data=True, install_requires=[ 'numpy', 'requests', 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 2/2] 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 1ae078b7..3152809f 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