fix double serveur nginx -> tout tourne sur le nginx du front
This commit is contained in:
@@ -1,26 +1,11 @@
|
|||||||
services:
|
services:
|
||||||
nginx:
|
|
||||||
build:
|
|
||||||
context: ..
|
|
||||||
dockerfile: dockerfiles/nginx/Dockerfile
|
|
||||||
ports:
|
|
||||||
- "80:80"
|
|
||||||
depends_on:
|
|
||||||
- db
|
|
||||||
- etherpad
|
|
||||||
- back
|
|
||||||
- front
|
|
||||||
networks:
|
|
||||||
- app-network
|
|
||||||
|
|
||||||
front:
|
front:
|
||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
dockerfile: dockerfiles/front/Dockerfile
|
dockerfile: dockerfiles/front/Dockerfile
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
- "5000:5000"
|
- "80:80"
|
||||||
- "5080:80"
|
|
||||||
volumes:
|
volumes:
|
||||||
- ../doodlestudent/front:/app
|
- ../doodlestudent/front:/app
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -13,12 +13,8 @@ RUN npx ng build
|
|||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
|
|
||||||
COPY --from=build /app/dist/tlcfront /usr/share/nginx/html
|
COPY --from=build /app/dist/tlcfront /usr/share/nginx/html
|
||||||
COPY nginxFront.conf /etc/nginx/conf.d/default.conf
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
|
||||||
|
|
||||||
#docker build -f dockerfiles/front/Dockerfile -t front_image .
|
|
||||||
#docker run --rm -p8080:80 front_image
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
FROM nginx:latest
|
|
||||||
|
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
||||||
|
|
||||||
COPY index.html /usr/share/nginx/html/
|
|
||||||
|
|
||||||
EXPOSE 80
|
|
||||||
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
63
nginx.conf
63
nginx.conf
@@ -1,6 +1,3 @@
|
|||||||
##########################
|
|
||||||
## FRONTEND + API
|
|
||||||
##########################
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
@@ -10,7 +7,7 @@ server {
|
|||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
# Proxy API requests to the back service
|
# API
|
||||||
##########################
|
##########################
|
||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass http://back:8080;
|
proxy_pass http://back:8080;
|
||||||
@@ -19,57 +16,23 @@ server {
|
|||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
proxy_set_header Connection "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
# FrontEnd returns
|
# Etherpad (optionnel)
|
||||||
##########################
|
##########################
|
||||||
location / {
|
location /pad/ {
|
||||||
proxy_pass http://front:5080;
|
proxy_pass http://etherpad:9001/;
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_set_header Connection "";
|
|
||||||
}
|
|
||||||
|
|
||||||
error_page 500 502 503 504 /50x.html;
|
|
||||||
location = /50x.html {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
##
|
|
||||||
## BACKEND
|
|
||||||
##
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
server_name _;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_pass http://back:8080;
|
|
||||||
proxy_set_header Host $http_host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
##
|
|
||||||
## ETHERPAD
|
|
||||||
##
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
server_name _;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_pass http://etherpad:9001;
|
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
}
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
|
##########################
|
||||||
|
# Front Angular
|
||||||
|
##########################
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user