diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ef97a0a --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +docker/entrypoint.sh text eol=lf \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index b0d9462..2e20c83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,10 +36,12 @@ WORKDIR /app COPY --from=builder /opt/venv /opt/venv COPY proxy ./proxy COPY README.md LICENSE ./ +COPY docker/entrypoint.sh ./docker/entrypoint.sh +RUN sed -i 's/\r$//' ./docker/entrypoint.sh && chmod +x ./docker/entrypoint.sh USER app EXPOSE 1443/tcp -ENTRYPOINT ["/usr/bin/tini", "--", "/bin/sh", "-lc", "set -eu; args=\"--host ${TG_WS_PROXY_HOST} --port ${TG_WS_PROXY_PORT}\"; for dc in ${TG_WS_PROXY_DC_IPS}; do args=\"$args --dc-ip $dc\"; done; exec python -u proxy/tg_ws_proxy.py $args \"$@\"", "--"] +ENTRYPOINT ["/usr/bin/tini", "--", "/app/docker/entrypoint.sh"] CMD [] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100644 index 0000000..b05542a --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -eu +args="--host ${TG_WS_PROXY_HOST} --port ${TG_WS_PROXY_PORT}" +for dc in ${TG_WS_PROXY_DC_IPS}; do + args="$args --dc-ip $dc" +done +exec python -u proxy/tg_ws_proxy.py $args "$@"