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

Change prod conf file + add local docker

parent 57bac963
No related branches found
No related tags found
2 merge requests!8local- conf,!7feat: add front office
......@@ -11,6 +11,6 @@ RUN npm run build
FROM nginx:1.16
COPY --from=build-stage /app/build/ /usr/share/nginx/html
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
COPY ./nginx/site.pro.conf /etc/nginx/conf.d/default.conf
COPY ./nginx/site.prod.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file
......@@ -6,13 +6,14 @@ services:
volumes:
- ./nginx/site.conf:/etc/nginx/conf.d/default.conf
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
command: ["nginx", "-g", "daemon off;"]
- ./cert.pem:/etc/nginx/cert.pem
- ./key.pem:/etc/nginx/key.pem
command: ['nginx', '-g', 'daemon off;']
ports:
- 8081:8080
networks:
backoffice:
depends_on:
- front
- 8080:8080
# depends_on:
# front:
# condition: service_healthy
links:
- front
......@@ -23,10 +24,52 @@ services:
- ./:/usr/app
working_dir: /usr/app
ports:
- 3000:3000
networks:
backoffice:
- 3000:3000
healthcheck:
test: curl localhost:3000
interval: 5s
timeout: 10s
retries: 60
database:
image: mysql:5
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: ${DATABASE_PASSWORD}
MYSQL_DATABASE: ${DATABASE_NAME}
healthcheck:
test: mysqladmin ping -h 127.0.0.1 -u root --password=$$MYSQL_ROOT_PASSWORD
interval: 5s
timeout: 10s
retries: 60
networks:
backoffice:
\ No newline at end of file
backend:
image: registry.forge.grandlyon.com/web-et-numerique/llle_project/backoffice-server:dev
depends_on:
database:
condition: service_healthy
restart: unless-stopped
volumes:
- /etc/localtime:/etc/localtime:ro
- ./configs:/app/configs
- ./letsencrypt_cache:/app/letsencrypt_cache
- ./data:/app/data
ports:
- ${HTTPS_PORT}:${HTTPS_PORT}
- 8090:8090
environment:
- HOSTNAME=${HOSTNAME}
- HTTPS_PORT=${HTTPS_PORT}
- ADMIN_ROLE=${ADMIN_ROLE}
- REDIRECT_URL=${REDIRECT_URL}
- CLIENT_ID=${CLIENT_ID}
- CLIENT_SECRET=${CLIENT_SECRET}
- AUTH_URL=${AUTH_URL}
- TOKEN_URL=${TOKEN_URL}
- USERINFO_URL=${USERINFO_URL}
- DEBUG_MODE=${DEBUG_MODE}
- DATABASE_USER=${DATABASE_USER}
- DATABASE_NAME=${DATABASE_NAME}
- DATABASE_PASSWORD=${DATABASE_PASSWORD}
- DATABASE_HOST=database
version: '3.7'
services:
nginx:
image: registry.forge.grandlyon.com/web-et-numerique/llle_project/backoffice-client:latest
image: registry.forge.grandlyon.com/web-et-numerique/llle_project/backoffice-client:dev
restart: unless-stopped
ports:
- 443:443
networks:
backoffice:
volumes:
- ./nginx/site.conf:/etc/nginx/conf.d/default.conf
- ./nginx/site.prod.conf:/etc/nginx/conf.d/default.conf
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./cert.pem:/etc/nginx/cert.pem
- ./key.pem:/etc/nginx/key.pem
......@@ -29,7 +29,7 @@ services:
retries: 60
backend:
image: registry.forge.grandlyon.com/web-et-numerique/llle_project/backoffice-server:latest
image: registry.forge.grandlyon.com/web-et-numerique/llle_project/backoffice-server:dev
networks:
backoffice:
depends_on:
......
server {
listen 443 ssl;
listen 8080 ;
server_name localhost;
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 / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
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;
}
location /api {
proxy_pass https://backend:1443/api;
......
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
}
server {
listen 443 ssl;
server_name localhost;
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 / {
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;
}
location /OAuth2Login {
proxy_pass https://backend:1443/OAuth2Login;
}
location /OAuth2Callback {
proxy_pass https://backend:1443/OAuth2Callback;
}
location /Logout {
proxy_pass https://backend:1443/Logout;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment