From 63498de844c08fb3f4501a5a18a3a3ffd0617092 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sun, 5 Nov 2023 14:20:20 +0800 Subject: [PATCH] build: update syncplay docker script --- Dockerfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 946a320..4542ce7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,16 @@ -ARG PYTHON="python:3.9-alpine3.17" +ARG PYTHON="python:3.9-alpine3.18" -FROM ${PYTHON} as build +FROM ${PYTHON} AS builder ENV SYNCPLAY="1.7.0" RUN apk add gcc musl-dev libffi-dev -RUN if [ "$(getconf LONG_BIT)" == "32" ]; then apk add cargo openssl-dev; fi +RUN sh -c '[ $(getconf LONG_BIT) -eq 64 ] || apk add cargo openssl-dev' RUN wget https://github.com/Syncplay/syncplay/archive/v${SYNCPLAY}.tar.gz -O- | tar xz WORKDIR ./syncplay-${SYNCPLAY}/ RUN cat /dev/null > requirements_gui.txt RUN SNAPCRAFT_PART_BUILD=1 pip wheel --wheel-dir /wheels/ ./ + +FROM ${PYTHON} AS syncplay +COPY --from=builder /wheels/ /wheels/ WORKDIR /release/local/lib/ RUN mkdir $(basename /usr/local/lib/python3.*/) && cd ./python3.*/ && \ ls /wheels/*.whl | xargs -P0 -n1 unzip -d ./site-packages/ @@ -15,7 +18,8 @@ COPY ./boot.py /release/bin/syncplay FROM ${PYTHON} RUN apk add --no-cache libffi openssl -COPY --from=build /release/ /usr/ +COPY --from=syncplay /release/ /usr/ ENV PYTHONUNBUFFERED=1 EXPOSE 8999 +WORKDIR /data/ ENTRYPOINT ["syncplay"]