commit 7f21fe4d25a4e82a0d6142d360dacc4f852c7ea0 Author: dnomd343 Date: Sun Jun 26 21:40:33 2022 +0800 feat: docker of syncplay diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8f93cdb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.7-alpine as build +RUN apk add build-base cargo git libffi-dev openssl-dev && \ + pip install -U pip && cd / && mkdir wheels && \ + git clone --depth=1 --branch=v1.6.9 https://github.com/syncplay/syncplay.git && \ + echo "" > syncplay/requirements_gui.txt && \ + cd wheels && SNAPCRAFT_PART_BUILD=1 pip wheel file:///syncplay#egg=syncplay + +FROM python:3.7-alpine +COPY ./init.sh /syncplay +COPY --from=build /wheels /wheels +RUN apk add --no-cache openssl libffi && pip install /wheels/*.whl +EXPOSE 8999 +ENTRYPOINT ["/syncplay"] diff --git a/init.sh b/init.sh new file mode 100755 index 0000000..e275d4f --- /dev/null +++ b/init.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +args="--salt=$SALT" + +[ -n "$TLS" ] && args="$args --tls=$TLS" + +[ -n "$PORT" ] && args="$args --port=$PORT" + +[ -n "$ISOLATE" ] && args="$args --isolate-rooms" + +[ -n "$PASSWORD" ] && args="$args --password=$PASSWORD" + +if [ -n "$MOTD" ]; then + echo "$MOTD" >> /app/syncplay/motd + args="$args --motd-file=/app/syncplay/motd" +fi + +PYTHONUNBUFFERED=1 exec syncplay-server $args $@