From baba5b7a452b9ff97584df05d1eeea57e21f609e Mon Sep 17 00:00:00 2001 From: Jonas Plum Date: Wed, 6 Nov 2024 01:52:48 +0100 Subject: [PATCH] feat: docker entrypoint with environment variables (#1112) --- docker/Dockerfile | 4 +++- docker/entrypoint.sh | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 docker/entrypoint.sh diff --git a/docker/Dockerfile b/docker/Dockerfile index cfab460..a7e69b3 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -11,4 +11,6 @@ VOLUME /usr/local/bin/catalyst_data HEALTHCHECK --interval=5s --timeout=3s --retries=3 \ CMD curl -f http://localhost:8080/health || exit 1 -CMD ["/usr/local/bin/catalyst", "serve", "--http", "0.0.0.0:8080"] \ No newline at end of file +COPY docker/entrypoint.sh /entrypoint.sh + +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100644 index 0000000..1a5a78d --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Set the flags +FLAGS="" +if [ -n "$CATALYST_FLAGS" ]; then + FLAGS="$CATALYST_FLAGS" +fi + +# Set the app url +APP_URL="" +if [ -n "$CATALYST_APP_URL" ]; then + APP_URL="$CATALYST_APP_URL" +fi + +/usr/local/bin/catalyst serve --http 0.0.0.0:8080 --flags "$FLAGS" --app-url "$APP_URL" \ No newline at end of file