From d72367ccaae49b40fdab92040b3a792f6fb13855 Mon Sep 17 00:00:00 2001 From: cami Date: Tue, 13 Jul 2021 20:03:20 +0200 Subject: [PATCH 1/3] removed port mapping in backend as it's not needed --- docker-compose.prod.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 2ed9b8c..d4ea493 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -8,8 +8,6 @@ services: backend-prod: image: caminsha/bt-backend container_name: backend_bt - ports: - - 5000:5000 environment: DEBUG: "no" PORT: 5000 From 07e83e2f0016ff0b5d7ea8262b782a0e6043b390 Mon Sep 17 00:00:00 2001 From: cami Date: Tue, 13 Jul 2021 20:03:51 +0200 Subject: [PATCH 2/3] added working nginx configuration --- frontend/nginx/nginx.conf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/nginx/nginx.conf b/frontend/nginx/nginx.conf index 615920f..2c1c60e 100644 --- a/frontend/nginx/nginx.conf +++ b/frontend/nginx/nginx.conf @@ -1,15 +1,19 @@ server { listen 80; + location / { root /usr/share/nginx/html; index index.html index.htm; # to redirect all the requests to index.html, # useful when you are using react-router try_files $uri /index.html; - proxy_pass http://localhost:5000 } + + location /api { + # include uwsgi_params; + # uwsgi_pass http://backend-prod:5000; + proxy_pass http://backend-prod:5000; + } + error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } } From ccd53bc2a10469a2441ac2d96dc4fa883ba92727 Mon Sep 17 00:00:00 2001 From: cami Date: Tue, 13 Jul 2021 20:04:56 +0200 Subject: [PATCH 3/3] replaced useState from dev.react to stable --- frontend/src/components/pages/BehaviorNormal.js | 3 +-- frontend/src/components/pages/Login.js | 3 +-- frontend/src/components/pages/Register.js | 3 +-- frontend/src/components/pages/Secret.js | 2 +- frontend/src/components/pages/Umfrage.js | 3 +-- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/pages/BehaviorNormal.js b/frontend/src/components/pages/BehaviorNormal.js index b8ce005..5b71911 100644 --- a/frontend/src/components/pages/BehaviorNormal.js +++ b/frontend/src/components/pages/BehaviorNormal.js @@ -1,10 +1,9 @@ -import React, { useEffect } from "react"; +import React, { useEffect, useState} from "react"; import "../../App.css"; import Footer from "../../Footer"; import { Logger } from "@behametrics/logger-web"; import { useAuth } from "../../auth/AuthProvider"; import InputField from "../InputField"; -import { useState } from "react/cjs/react.development"; import SubmitField from "../SubmitField"; export default function BehaviorNormal() { diff --git a/frontend/src/components/pages/Login.js b/frontend/src/components/pages/Login.js index 4524eda..527105a 100644 --- a/frontend/src/components/pages/Login.js +++ b/frontend/src/components/pages/Login.js @@ -1,5 +1,4 @@ -import React from "react"; -import { useState } from "react/cjs/react.development"; +import React, {useState} from "react"; import "../../App.css"; import Footer from "../../Footer"; import InputField from "../InputField"; diff --git a/frontend/src/components/pages/Register.js b/frontend/src/components/pages/Register.js index 8a198a3..ab4707a 100644 --- a/frontend/src/components/pages/Register.js +++ b/frontend/src/components/pages/Register.js @@ -1,5 +1,4 @@ -import React from "react"; -import { useState } from "react/cjs/react.development"; +import React, {useState} from "react"; import "../../App.css"; import Footer from "../../Footer"; import InputField from "../InputField"; diff --git a/frontend/src/components/pages/Secret.js b/frontend/src/components/pages/Secret.js index 5101e9b..ed0b002 100644 --- a/frontend/src/components/pages/Secret.js +++ b/frontend/src/components/pages/Secret.js @@ -1,4 +1,4 @@ -import { useEffect, useState } from "react/cjs/react.development"; +import { useEffect, useState } from "react"; import { authFetch } from "../../auth/AuthProvider.js"; function Secret() { diff --git a/frontend/src/components/pages/Umfrage.js b/frontend/src/components/pages/Umfrage.js index 8e99ba8..6a6b0e1 100644 --- a/frontend/src/components/pages/Umfrage.js +++ b/frontend/src/components/pages/Umfrage.js @@ -1,5 +1,4 @@ -import React from "react"; -import { useState } from "react/cjs/react.development"; +import React, {useState} from "react"; import "../../App.css"; import "../Input.css"; import Footer from "../../Footer";