Browse Source

feat: boot container with python script

pull/2/head
Dnomd343 2 years ago
parent
commit
f789292407
  1. 10
      Dockerfile
  2. 15
      boot.py

10
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"]

15
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)
Loading…
Cancel
Save