Merge pull request 'refactor: allow env variables to configure api urls' (#170) from bnyro/Hyperpipe:dockerfile-env into main

Reviewed-on: https://codeberg.org/Hyperpipe/Hyperpipe/pulls/170
This commit is contained in:
Shiny Nematoda 2024-06-18 15:39:49 +00:00
commit 6f2756181c
2 changed files with 17 additions and 0 deletions

View file

@ -13,5 +13,7 @@ FROM --platform=$TARGETPLATFORM 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;"