From 952aa3261ab271f11d63cb52b983cf599442774c Mon Sep 17 00:00:00 2001 From: Daithi Hearn Date: Thu, 13 Apr 2023 21:56:38 +0200 Subject: [PATCH 1/2] Adding server name nginx config --- .env | 1 + Dockerfile | 2 +- nginx/default.conf | 4 +++- substitute.env | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.env b/.env index d923c71..04903a9 100644 --- a/.env +++ b/.env @@ -1,4 +1,5 @@ PORT=3000 +REACT_SERVER_NAME=default_server REACT_APP_API_URL=http://localhost:7080 REACT_APP_WEBSOCKET_URL=http://localhost:7070 diff --git a/Dockerfile b/Dockerfile index 2ff1169..3e916ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,4 +21,4 @@ COPY --from=builder /app/build /usr/share/nginx/html COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf COPY ./nginx/nginx.conf /etc/nginx/nginx.conf -CMD sed -i -e 's|$PORT|'"$PORT"'|g' /etc/nginx/conf.d/default.conf && find /usr/share/nginx/html/static/js -type f -name '*.js' -exec sed -i -e 's|$API_URL|'"$API_URL"'|g' {} \; && find /usr/share/nginx/html/static/js -type f -name '*.js' -exec sed -i -e 's|$WEBSOCKET_URL|'"$WEBSOCKET_URL"'|g' {} \; && find /usr/share/nginx/html/static/js -type f -name '*.js' -exec sed -i -e 's|$AUTH0_DOMAIN|'"$AUTH0_DOMAIN"'|g' {} \; && find /usr/share/nginx/html/static/js -type f -name '*.js' -exec sed -i -e 's|$AUTH0_AUDIENCE|'"$AUTH0_AUDIENCE"'|g' {} \; && find /usr/share/nginx/html/static/js -type f -name '*.js' -exec sed -i -e 's|$AUTH0_CLIENT_ID|'"$AUTH0_CLIENT_ID"'|g' {} \; && find /usr/share/nginx/html/static/js -type f -name '*.js' -exec sed -i -e 's|$AUTH0_SCOPE|'"$AUTH0_SCOPE"'|g' {} \; && nginx -g 'daemon off;' +CMD sed -i -e 's|$SERVER_NAME|'"$SERVER_NAME"'|g' /etc/nginx/conf.d/default.conf && sed -i -e 's|$PORT|'"$PORT"'|g' /etc/nginx/conf.d/default.conf && find /usr/share/nginx/html/static/js -type f -name '*.js' -exec sed -i -e 's|$API_URL|'"$API_URL"'|g' {} \; && find /usr/share/nginx/html/static/js -type f -name '*.js' -exec sed -i -e 's|$WEBSOCKET_URL|'"$WEBSOCKET_URL"'|g' {} \; && find /usr/share/nginx/html/static/js -type f -name '*.js' -exec sed -i -e 's|$AUTH0_DOMAIN|'"$AUTH0_DOMAIN"'|g' {} \; && find /usr/share/nginx/html/static/js -type f -name '*.js' -exec sed -i -e 's|$AUTH0_AUDIENCE|'"$AUTH0_AUDIENCE"'|g' {} \; && find /usr/share/nginx/html/static/js -type f -name '*.js' -exec sed -i -e 's|$AUTH0_CLIENT_ID|'"$AUTH0_CLIENT_ID"'|g' {} \; && find /usr/share/nginx/html/static/js -type f -name '*.js' -exec sed -i -e 's|$AUTH0_SCOPE|'"$AUTH0_SCOPE"'|g' {} \; && nginx -g 'daemon off;' diff --git a/nginx/default.conf b/nginx/default.conf index c9c7c57..d5887a6 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -1,5 +1,7 @@ server { - listen $PORT default_server; + listen $PORT; + + server_name $SERVER_NAME; #charset koi8-r; #access_log /var/log/nginx/host.access.log main; diff --git a/substitute.env b/substitute.env index 80c97d6..f8eb84a 100644 --- a/substitute.env +++ b/substitute.env @@ -1,4 +1,5 @@ PORT=80 +REACT_SERVER_NAME=\$SERVER_NAME REACT_APP_API_URL=\$API_URL REACT_APP_WEBSOCKET_URL=\$WEBSOCKET_URL From 85d57730fb9d0b9e71f20298f5a1e910e17e35e3 Mon Sep 17 00:00:00 2001 From: Daithi Hearn Date: Thu, 13 Apr 2023 21:59:56 +0200 Subject: [PATCH 2/2] Updating version --- package.json | 2 +- public/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index cec5543..3af439d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "frontend", - "version": "6.1.0", + "version": "6.1.1", "description": "React frontend for the Cards 110", "author": "Daithi Hearn", "license": "MIT", diff --git a/public/manifest.json b/public/manifest.json index b76e724..918a182 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,7 +1,7 @@ { "short_name": "Cards 110", "name": "Cards 110", - "version": "6.1.0", + "version": "6.1.1", "icons": [ { "src": "./assets/favicon.png",