From 8037271a76be7b746b35fff49948804105057a13 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Mon, 17 Jun 2024 19:23:36 +0200 Subject: [PATCH] Add version check --- Dockerfile | 2 ++ entrypoint.sh | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/Dockerfile b/Dockerfile index e4f98c2..1e462e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,8 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local COPY --from=ghcr.io/ufoscout/docker-compose-wait:latest /wait /usr/local/bin/docker-compose-wait +RUN echo 1.0.0 > /tas_version + EXPOSE 9503 ENTRYPOINT ["./entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 74a8b80..12659ca 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,12 @@ #!/usr/bin/env sh +VERSION=1.0.0 +CURRENT_VERSION=$(cat /tas_version) + +if [ "$VERSION" != "$CURRENT_VERSION" ]; then + echo "Wrong docker image version, expected $VERSION, got $CURRENT_VERSION, please run docker compose pull!" + exit 1 +fi + docker-compose-wait \ && nice -n 20 php server.php -e=.env.docker --docker "$@" \ No newline at end of file