From f7892924078675c864328c042fbfdfc7b473c963 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Tue, 21 Mar 2023 11:22:52 +0800 Subject: [PATCH] feat: boot container with python script --- Dockerfile | 10 ++++------ boot.py | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) create mode 100755 boot.py diff --git a/Dockerfile b/Dockerfile index da78945..4b98771 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,16 +9,14 @@ WORKDIR ./syncplay-${SYNCPLAY}/ RUN cat /dev/null > requirements_gui.txt RUN SNAPCRAFT_PART_BUILD=1 pip wheel --wheel-dir /wheels/ ./ WORKDIR /wheels/ -RUN pip install *.whl RUN ls *.whl | xargs -P0 -n1 unzip -d /unzip/ -WORKDIR /release/lib/python3.7/ +WORKDIR /release/local/lib/python3.7/ RUN cp -r /unzip/ ./site-packages/ -WORKDIR /release/bin/ -RUN cp /usr/local/bin/syncplay-server ./ -COPY ./init.sh ./syncplay +COPY ./boot.py /release/bin/syncplay FROM ${PYTHON} RUN apk add --no-cache libffi openssl -COPY --from=build /release/ /usr/local/ +COPY --from=build /release/ /usr/ +ENV PYTHONUNBUFFERED=1 EXPOSE 8999 ENTRYPOINT ["syncplay"] diff --git a/boot.py b/boot.py new file mode 100755 index 0000000..f833825 --- /dev/null +++ b/boot.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +import os +import sys +import time + +# def runSyncplay(args: list, envs: dict) -> None: +# os.execvpe('syncplay-server', ['syncplay-server'] + args, envs) + +# runSyncplay(['--password', 'test'], {'PYTHONUNBUFFERED': '1'}) + +print(sys.argv) +print(os.environ) + +time.sleep(200)