refactor: allow env variables to configure api urls

This commit is contained in:
Bnyro 2024-06-16 12:19:48 +02:00
parent ecd6165ec2
commit a6290e3c75
2 changed files with 17 additions and 0 deletions

View file

@ -13,5 +13,7 @@ FROM --platform=$BUILDPLATFORM nginx:stable-alpine
COPY --from=build /app/dist/ /usr/share/nginx/html/ COPY --from=build /app/dist/ /usr/share/nginx/html/
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY docker/entrypoint.sh /entrypoint.sh
EXPOSE 80 EXPOSE 80
ENTRYPOINT [ "/entrypoint.sh" ]

15
docker/entrypoint.sh Executable file
View file

@ -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;"