Skip to content
Snippets Groups Projects
Commit f4c5db70 authored by Guilhem CARRON's avatar Guilhem CARRON
Browse files

Add working local conf

parent 09a627c6
No related branches found
No related tags found
2 merge requests!8local- conf,!7feat: add front office
version: '3.7'
services:
nginx:
image: nginx:1.16
restart: unless-stopped
front:
container_name: front
build:
context: .
dockerfile: Dockerfile
depends_on:
database:
condition: service_healthy
volumes:
- ./nginx/site.conf:/etc/nginx/conf.d/default.conf
- '/app'
- '/app/node_modules'
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/site.conf:/etc/nginx/conf.d/default.conf
- ./cert.pem:/etc/nginx/cert.pem
- ./key.pem:/etc/nginx/key.pem
command: ['nginx', '-g', 'daemon off;']
ports:
- 8080:8080
# depends_on:
# front:
# condition: service_healthy
links:
- front
front:
image: bayesimpact/react-base
restart: unless-stopped
volumes:
- ./:/usr/app
working_dir: /usr/app
ports:
- 3000:3000
healthcheck:
test: curl localhost:3000
interval: 5s
timeout: 10s
retries: 60
- 443:443
database:
image: mysql:5
......
server {
listen 8080 ;
server_name localhost;
listen 8080;
server_name local;
location / {
proxy_pass https://front:3000;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
location /api {
proxy_pass https://backend:1443/api;
......@@ -23,7 +19,23 @@ server {
location /Logout {
proxy_pass https://backend:1443/Logout;
}
location /swagger {
proxy_pass https://backend:1443/swagger;
}
}
server {
listen 443 ssl;
server_name local;
ssl_certificate /etc/nginx/cert.pem;
ssl_certificate_key /etc/nginx/key.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_pass http://localhost:8080;
}
location /OAuth2Callback {
proxy_pass https://backend:1443/OAuth2Callback;
}
}
\ No newline at end of file
......@@ -5,6 +5,8 @@
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"docker-local-up" : "docker-compose -f docker-compose.local.yml up",
"docker-local-down" : "docker-compose -f docker-compose.local.yml down",
"docker": "docker run -it --rm -p 3000:3000 front-backoffice",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
......
......@@ -11,7 +11,12 @@ const Routes: React.FC = () => {
return (
<Switch>
{user && <Redirect path="/login" to="/editing" />}
{user && (
<>
<Redirect path="/" to="/editing" />
<Redirect path="/login" to="/editing" />
</>
)}
<Route path="/login" component={Login} />
<PrivateRoute path="/editing" component={Editing} exact />
<PrivateRoute path="/settings" component={Settings} exact />
......
/// <reference types="react-scripts" />
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment