From 60ed8bbaca20e0c22a40d05e13cca404bfe56462 Mon Sep 17 00:00:00 2001 From: jamiefeiss Date: Wed, 28 Feb 2024 15:17:44 +1100 Subject: [PATCH] Docker entrypoint script now overrides base url when not specified, removed redunant mimetype in nginx config --- docker_entrypoint.sh | 4 +++- nginx.conf | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docker_entrypoint.sh b/docker_entrypoint.sh index e77dff3..af9a465 100644 --- a/docker_entrypoint.sh +++ b/docker_entrypoint.sh @@ -19,7 +19,9 @@ if (declare -p "VITE_BASE_URL" &>/dev/null) then sed -i "s|BASE_URL = \"/\"|BASE_URL = \"$VITE_BASE_URL\"|g" /app/index.html sed -i "s|/@BASE_URL@/|$VITE_BASE_URL|g" /app/index.html ${INDEX_FILE} - cp /app/index.html /app/404.html +else + sed -i "s|/@BASE_URL@/|/|g" /app/index.html ${INDEX_FILE} fi +cp /app/index.html /app/404.html nginx -g 'daemon off;'; \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index 851045c..ad32fa0 100644 --- a/nginx.conf +++ b/nginx.conf @@ -16,7 +16,7 @@ http { access_log /var/log/nginx/access.log; gzip on; - gzip_types text/html application/javascript application/json text/css; + gzip_types application/javascript application/json text/css; root /app; index index.html;