diff --git a/Dockerfile b/Dockerfile index 54347aa..ae17dc9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,5 +13,7 @@ FROM --platform=$TARGETPLATFORM nginx:stable-alpine COPY --from=build /app/dist/ /usr/share/nginx/html/ COPY docker/nginx.conf /etc/nginx/conf.d/default.conf +COPY docker/entrypoint.sh /entrypoint.sh EXPOSE 80 +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100755 index 0000000..39e83fb --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +if [ -z "$PIPED_API" ]; then + echo "PIPED_API not set" + exit 1 +fi + +if [ -z "$HYP_API" ]; then + echo "HYP_API not set" + exit 1 +fi + +find /usr/share/nginx/html -type f -exec sed -i s/pipedapi.kavin.rocks/$PIPED_API/g {} \; -exec sed -i s/hyperpipeapi.onrender.com/$HYP_API/g {} \; + +nginx -g "daemon off;"