diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..2ceece2b3 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,18 @@ + +# editor configs +**/.idea/ +**/.vscode/ +**/.gradle/ +**/.DS_Store/ + +.git/ + +# logs +*-debug.log +*-error.log + +**/node_modules/ + +# build directories +**/build/ +**/lib/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 7f7923184..43ae1a9b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,7 @@ FROM nginx:1.21-alpine COPY dist/hypertrace-ui /usr/share/nginx/html COPY conf/default.conf /etc/nginx/conf.d/default.conf -COPY copy-secrets.sh /usr/share/nginx/html +COPY copy-secrets.sh /docker-entrypoint.d/ RUN chmod a+w /var/cache/nginx /var/run -RUN chmod +x /usr/share/nginx/html/copy-secrets.sh EXPOSE 2020 -HEALTHCHECK --interval=1s --retries=5 --timeout=1s CMD wget -qO- http://localhost:2020/graphql?query={__schema{queryType{name}}} &> /dev/null || exit 1 -ENTRYPOINT copy-secrets.sh \ No newline at end of file +HEALTHCHECK --interval=1s --retries=5 --timeout=1s CMD wget -qO- http://localhost:2020/graphql?query={__schema{queryType{name}}} &> /dev/null || exit 1 \ No newline at end of file diff --git a/copy-secrets.sh b/copy-secrets.sh index 2d9a905b9..59bde4d54 100755 --- a/copy-secrets.sh +++ b/copy-secrets.sh @@ -1,14 +1,14 @@ -#!/bin/sh -touch secrets.js +FILENAME="/usr/share/nginx/html/secrets.js" +touch $FILENAME if [ -z $ENABLE_ANALYTICS ] then ENABLE_ANALYTICS="false" fi -echo "window.ENABLE_ANALYTICS = \"$ENABLE_ANALYTICS\";" > secrets.js +echo "window.ENABLE_ANALYTICS = \"$ENABLE_ANALYTICS\";" > $FILENAME if [ "$ENABLE_ANALYTICS" = "true" ] then - echo "window.RUDDERSTACK_HT_WRITE_KEY = \"$RUDDERSTACK_HT_WRITE_KEY\";" >> secrets.js - echo "window.RUDDERSTACK_HT_DATAPLANE_URL = \"$RUDDERSTACK_HT_DATAPLANE_URL\";" >> secrets.js + echo "window.RUDDERSTACK_HT_WRITE_KEY = \"$RUDDERSTACK_HT_WRITE_KEY\";" >> $FILENAME + echo "window.RUDDERSTACK_HT_DATAPLANE_URL = \"$RUDDERSTACK_HT_DATAPLANE_URL\";" >> $FILENAME else echo "Analytics is disabled" fi \ No newline at end of file