Loading docker-compose.prod.yml +26 −21 Original line number Diff line number Diff line version: '3.8' services: react-frontend: build: context: ./react-frontend dockerfile: Dockerfile.prod depends_on: - tornado-backend networks: - app-network #react-frontend: # build: # context: ./react-frontend # dockerfile: Dockerfile.prod # depends_on: # - tornado-backend # networks: # - app-network tornado-backend: build: ./tornado-backend command: --db_host=postgres ports: - 8888:8888 depends_on: - postgres networks: - app-network - nginx-network postgres: image: postgres:10.3 Loading @@ -36,19 +39,21 @@ services: networks: - app-network nginx: image: nginx:latest ports: - "80:80" volumes: - ./react-frontend/my-react-app/build:/usr/share/nginx/html:ro - ./nginx/nginx.prod.conf:/etc/nginx/nginx.conf:ro depends_on: - react-frontend - tornado-backend networks: - app-network #nginx: # image: nginx:latest # ports: # - "80:80" # volumes: # - ./react-frontend/my-react-app/build:/usr/share/nginx/html:ro # - ./nginx/nginx.prod.conf:/etc/nginx/nginx.conf:ro # depends_on: # - react-frontend # - tornado-backend # networks: # - app-network networks: app-network: driver: bridge nginx-network: external: true react-frontend/my-react-app/package.json +1 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ "name": "app", "version": "0.1.0", "private": true, "homepage": "/aidaho-blog-demo", "dependencies": { "bootstrap": "^5.3.3", "cra-template": "1.2.0", Loading react-frontend/my-react-app/src/App.js +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ function App() { // </header> // </div> <UserRoleProvider> <Router> <Router basename="/aidaho-blog-demo"> <Logo /> <Navbar /> <div className="container mt-5"> Loading react-frontend/my-react-app/src/components/Login.js +2 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ import config from '../config'; function Login() { // const navigate = useNavigate(); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); Loading Loading @@ -42,7 +43,7 @@ function Login() { console.log('logging of response status: ', response.ok); if (response.ok) { window.location.href = '/'; // Redirect to home page window.location.href = `${config.frontendBaseUrl}/` } } catch (error) { alert('Login failed!') Loading react-frontend/my-react-app/src/components/Register.js +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ function Register() { }); console.log('logging of response status: ', response.ok); if (response.ok) { window.location.href = '/login'; // Redirect to home page window.location.href = `${config.frontendBaseUrl}/login` } } catch (error) { alert('Registering failed!') Loading Loading
docker-compose.prod.yml +26 −21 Original line number Diff line number Diff line version: '3.8' services: react-frontend: build: context: ./react-frontend dockerfile: Dockerfile.prod depends_on: - tornado-backend networks: - app-network #react-frontend: # build: # context: ./react-frontend # dockerfile: Dockerfile.prod # depends_on: # - tornado-backend # networks: # - app-network tornado-backend: build: ./tornado-backend command: --db_host=postgres ports: - 8888:8888 depends_on: - postgres networks: - app-network - nginx-network postgres: image: postgres:10.3 Loading @@ -36,19 +39,21 @@ services: networks: - app-network nginx: image: nginx:latest ports: - "80:80" volumes: - ./react-frontend/my-react-app/build:/usr/share/nginx/html:ro - ./nginx/nginx.prod.conf:/etc/nginx/nginx.conf:ro depends_on: - react-frontend - tornado-backend networks: - app-network #nginx: # image: nginx:latest # ports: # - "80:80" # volumes: # - ./react-frontend/my-react-app/build:/usr/share/nginx/html:ro # - ./nginx/nginx.prod.conf:/etc/nginx/nginx.conf:ro # depends_on: # - react-frontend # - tornado-backend # networks: # - app-network networks: app-network: driver: bridge nginx-network: external: true
react-frontend/my-react-app/package.json +1 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ "name": "app", "version": "0.1.0", "private": true, "homepage": "/aidaho-blog-demo", "dependencies": { "bootstrap": "^5.3.3", "cra-template": "1.2.0", Loading
react-frontend/my-react-app/src/App.js +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ function App() { // </header> // </div> <UserRoleProvider> <Router> <Router basename="/aidaho-blog-demo"> <Logo /> <Navbar /> <div className="container mt-5"> Loading
react-frontend/my-react-app/src/components/Login.js +2 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ import config from '../config'; function Login() { // const navigate = useNavigate(); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); Loading Loading @@ -42,7 +43,7 @@ function Login() { console.log('logging of response status: ', response.ok); if (response.ok) { window.location.href = '/'; // Redirect to home page window.location.href = `${config.frontendBaseUrl}/` } } catch (error) { alert('Login failed!') Loading
react-frontend/my-react-app/src/components/Register.js +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ function Register() { }); console.log('logging of response status: ', response.ok); if (response.ok) { window.location.href = '/login'; // Redirect to home page window.location.href = `${config.frontendBaseUrl}/login` } } catch (error) { alert('Registering failed!') Loading