diff --git a/web/Dockerfile b/web/Dockerfile index ca13656c5d..a7b0b0f40e 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -68,6 +68,9 @@ ENV REEARTH_PUBLISHED=null ENV REEARTH_TITLE= ENV REEARTH_UNSAFE_PLUGIN_URLS=[] +RUN --mount=type=cache,target=/var/cache/apk \ + apk add --no-cache jq + COPY --from=builder --chown=nginx:nginx /app/dist /usr/share/nginx/html COPY --chown=nginx:nginx docker/nginx.conf.template /etc/nginx/templates/nginx.conf.template COPY --chown=nginx:nginx docker/40-envsubst-on-reearth-config.sh /docker-entrypoint.d diff --git a/web/docker/40-envsubst-on-reearth-config.sh b/web/docker/40-envsubst-on-reearth-config.sh index 73ca539de1..41cb51516b 100755 --- a/web/docker/40-envsubst-on-reearth-config.sh +++ b/web/docker/40-envsubst-on-reearth-config.sh @@ -36,3 +36,7 @@ wrap_reearth_variables() { wrap_reearth_variables "$@" envsubst < "$_REEARTH_CONFIG_TEMPLATE_FILE" > "$_REEARTH_CONFIG_OUTPUT_FILE" +if ! jq empty "$_REEARTH_CONFIG_OUTPUT_FILE" > /dev/null 2>&1; then + echo "Invalid JSON configuration file $_REEARTH_CONFIG_OUTPUT_FILE" >&2 + exit 1 +fi