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

Update Readme + prod conf files

parent 1a091ec1
No related branches found
No related tags found
1 merge request!7feat: add front office
Pipeline #16034 passed
...@@ -44,6 +44,8 @@ This app runs in https, such as the backend, to access it go on https://localhos ...@@ -44,6 +44,8 @@ This app runs in https, such as the backend, to access it go on https://localhos
Also make sure you have HTTPS env variable set to true. Also make sure you have HTTPS env variable set to true.
Do not use the app with the port 3000, you won't be able to login. Do not use the app with the port 3000, you won't be able to login.
> :warning: **If you are launching the project from a Linux OS** : Make sure to uncomment the commented lines in the docker-compose.local file. Otherwise, you you won't be able to access your machine's localhost from the docker container.
## Backend and Database ## Backend and Database
In order to get Backend documentation, please refer directly to the [backend project](https://forge.grandlyon.com/web-et-numerique/llle_project/backoffice-server) In order to get Backend documentation, please refer directly to the [backend project](https://forge.grandlyon.com/web-et-numerique/llle_project/backoffice-server)
...@@ -69,3 +71,11 @@ On dev and master branches, the pipeline will run a docker image build that you ...@@ -69,3 +71,11 @@ On dev and master branches, the pipeline will run a docker image build that you
This app uses Draft.js Wysiwyg editor for more information checkout its (documentation page)[https://draftjs.org/docs/getting-started] This app uses Draft.js Wysiwyg editor for more information checkout its (documentation page)[https://draftjs.org/docs/getting-started]
For more advanced documentation about editor customization, please checkout the (react draft wysiwig page)[https://jpuri.github.io/react-draft-wysiwyg/#/docs?_k=jjqinp] For more advanced documentation about editor customization, please checkout the (react draft wysiwig page)[https://jpuri.github.io/react-draft-wysiwyg/#/docs?_k=jjqinp]
### Environment Variables
There is a template.env file in this project, however you can ask one the developpers to get a ready-to-use .env file.
- IMAGE_FOLDER: this variable specify the folder where ecogestures images are located. By default, you can place this folder at the same level as your project for a local usage. (not inside the project). For alpha, rec/prod environment, make sure the path indicated in docker-compose volumes correspond with the location of the image file on the server.
- MOCK_OAUTH2: Set this variable to true while in local, so the OAuth2 dance will be mocked by backend and you will be able to login to your application.
...@@ -4,21 +4,23 @@ services: ...@@ -4,21 +4,23 @@ services:
image: registry.forge.grandlyon.com/web-et-numerique/llle_project/backoffice-client:dev image: registry.forge.grandlyon.com/web-et-numerique/llle_project/backoffice-client:dev
restart: unless-stopped restart: unless-stopped
ports: ports:
- 443:443 - 8088:8080
depends_on:
- backend
networks: networks:
backoffice: backoffice:
volumes: volumes:
- ./nginx/site.prod.conf:/etc/nginx/conf.d/default.conf - ./site.conf:/etc/nginx/conf.d/default.conf
- ./nginx/nginx.conf:/etc/nginx/nginx.conf - ./image-lib:/usr/share/nginx/html/lib
- ./cert.pem:/etc/nginx/cert.pem - ./dacc-preview:/usr/share/nginx/html/static-site
- ./key.pem:/etc/nginx/key.pem
database: database-agent:
image: mysql:5 image: mysql:5
ports: ports:
- 3306:3306 - 3306:3306
networks: networks:
backoffice: backoffice:
restart: unless-stopped
environment: environment:
MYSQL_ROOT_PASSWORD: ${DATABASE_PASSWORD} MYSQL_ROOT_PASSWORD: ${DATABASE_PASSWORD}
MYSQL_DATABASE: ${DATABASE_NAME} MYSQL_DATABASE: ${DATABASE_NAME}
...@@ -33,7 +35,7 @@ services: ...@@ -33,7 +35,7 @@ services:
networks: networks:
backoffice: backoffice:
depends_on: depends_on:
database: database-agent:
condition: service_healthy condition: service_healthy
restart: unless-stopped restart: unless-stopped
volumes: volumes:
...@@ -41,9 +43,10 @@ services: ...@@ -41,9 +43,10 @@ services:
- ./configs:/app/configs - ./configs:/app/configs
- ./letsencrypt_cache:/app/letsencrypt_cache - ./letsencrypt_cache:/app/letsencrypt_cache
- ./data:/app/data - ./data:/app/data
- ./image-lib/${IMAGE_FOLDER}:/app/${IMAGE_FOLDER}
ports: ports:
- ${HTTPS_PORT}:${HTTPS_PORT} - ${HTTPS_PORT}:${HTTPS_PORT}
- 8090:8090 - 8190:8090
environment: environment:
- HOSTNAME=${HOSTNAME} - HOSTNAME=${HOSTNAME}
- HTTPS_PORT=${HTTPS_PORT} - HTTPS_PORT=${HTTPS_PORT}
...@@ -52,14 +55,15 @@ services: ...@@ -52,14 +55,15 @@ services:
- CLIENT_ID=${CLIENT_ID} - CLIENT_ID=${CLIENT_ID}
- CLIENT_SECRET=${CLIENT_SECRET} - CLIENT_SECRET=${CLIENT_SECRET}
- AUTH_URL=${AUTH_URL} - AUTH_URL=${AUTH_URL}
- IMAGE_FOLDER=${IMAGE_FOLDER}
- MOCK_OAUTH2=${MOCK_OAUTH2}
- TOKEN_URL=${TOKEN_URL} - TOKEN_URL=${TOKEN_URL}
- USERINFO_URL=${USERINFO_URL} - USERINFO_URL=${USERINFO_URL}
- DEBUG_MODE=${DEBUG_MODE} - DEBUG_MODE=${DEBUG_MODE}
- MOCK_OAUTH2=${MOCK_OAUTH2}
- DATABASE_USER=${DATABASE_USER} - DATABASE_USER=${DATABASE_USER}
- DATABASE_NAME=${DATABASE_NAME} - DATABASE_NAME=${DATABASE_NAME}
- DATABASE_PASSWORD=${DATABASE_PASSWORD} - DATABASE_PASSWORD=${DATABASE_PASSWORD}
- DATABASE_HOST=database - DATABASE_HOST=database-agent
networks: networks:
backoffice: backoffice:
server { server {
listen 443 ssl; listen 8080;
server_name localhost; server_name ecolyo-agent.self-data.alpha.grandlyon.com;
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 / { location / {
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html index.htm; index index.html index.htm;
try_files $uri $uri/ /index.html =404; try_files $uri $uri/ /index.html =404;
} }
location /api { location /api {
proxy_pass https://backend:1443/api; proxy_pass https://backend:1443/api;
} }
...@@ -23,4 +20,19 @@ server { ...@@ -23,4 +20,19 @@ server {
location /Logout { location /Logout {
proxy_pass https://backend:1443/Logout; proxy_pass https://backend:1443/Logout;
} }
location /swagger {
proxy_pass https://backend:1443/swagger;
}
location /imageNames {
proxy_pass https://backend:1443/api/admin/imageNames;
}
location ~ ^/assets/(.+\.(?:gif|jpe?g|svg))$ {
alias /usr/share/nginx/html/lib/$1;
gzip_static on;
expires max;
add_header Cache-Control public;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment