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
This commit is contained in:
Checker8763 2025-05-17 19:48:31 +02:00 committed by GitHub
parent 1f86cd6294
commit fff5bc8fd8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 4 deletions

View File

@ -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 COPY ./* /build/websockify
RUN rm -rf /websockify-* /root/.cache
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 VOLUME /data