Skip to content

Commit

Permalink
Merge pull request #159 from daithihearn/domain-config
Browse files Browse the repository at this point in the history
Adding server name nginx config
  • Loading branch information
daithihearn authored Apr 13, 2023
2 parents ff595b3 + 85d5773 commit 7cffc97
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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;'
4 changes: 3 additions & 1 deletion nginx/default.conf
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"short_name": "Cards 110",
"name": "Cards 110",
"version": "6.1.0",
"version": "6.1.1",
"icons": [
{
"src": "./assets/favicon.png",
Expand Down
1 change: 1 addition & 0 deletions substitute.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PORT=80
REACT_SERVER_NAME=\$SERVER_NAME
REACT_APP_API_URL=\$API_URL
REACT_APP_WEBSOCKET_URL=\$WEBSOCKET_URL

Expand Down

0 comments on commit 7cffc97

Please sign in to comment.