From 43a84a3f1cb85721f08756ffcf89188f9da90891 Mon Sep 17 00:00:00 2001 From: PassiveLemon Date: Sun, 28 Apr 2024 10:55:45 -0400 Subject: [PATCH] Fix: Graceful container shutdown --- docker/Dockerfile | 11 ++++------- docker/entrypoint.sh | 4 ---- 2 files changed, 4 insertions(+), 11 deletions(-) delete mode 100644 docker/entrypoint.sh diff --git a/docker/Dockerfile b/docker/Dockerfile index 8ffd402..8636c0e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -8,10 +8,7 @@ RUN mkdir -p /opt/zoraxy/source/ &&\ mkdir -p /opt/zoraxy/config/ &&\ mkdir -p /usr/local/bin/ -COPY entrypoint.sh /opt/zoraxy/ - -RUN chmod -R 755 /opt/zoraxy/ &&\ - chmod +x /opt/zoraxy/entrypoint.sh +RUN chmod -R 770 /opt/zoraxy/ VOLUME [ "/opt/zoraxy/config/" ] @@ -24,15 +21,15 @@ RUN go mod tidy &&\ go build -o /usr/local/bin/zoraxy &&\ rm -r /opt/zoraxy/source/ -RUN chmod +x /usr/local/bin/zoraxy +RUN chmod 755 /usr/local/bin/zoraxy &&\ + chmod +x /usr/local/bin/zoraxy WORKDIR /opt/zoraxy/config/ ENV VERSION=$VERSION - ENV ARGS="-noauth=false" -ENTRYPOINT ["/opt/zoraxy/entrypoint.sh"] +ENTRYPOINT "zoraxy" "-port=:8000" "${ARGS}" HEALTHCHECK --interval=5s --timeout=5s --retries=2 CMD nc -vz 127.0.0.1 8000 || exit 1 diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh deleted file mode 100644 index cc51aff..0000000 --- a/docker/entrypoint.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -echo "Zoraxy version $VERSION" - -zoraxy -port=:8000 ${ARGS}