From a6290e3c750a9fc261c8bab12592e809d33d3170 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sun, 16 Jun 2024 12:19:48 +0200 Subject: [PATCH] refactor: allow env variables to configure api urls --- Dockerfile | 2 ++ docker/entrypoint.sh | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 docker/entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 828cabe..ab5268c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,5 +13,7 @@ FROM --platform=$BUILDPLATFORM 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;"