fix double serveur nginx -> tout tourne sur le nginx du front

This commit is contained in:
trochas
2026-02-12 17:22:11 +01:00
parent 8bc54e787b
commit 9f820449af
4 changed files with 17 additions and 82 deletions

View File

@@ -1,26 +1,11 @@
services:
nginx:
build:
context: ..
dockerfile: dockerfiles/nginx/Dockerfile
ports:
- "80:80"
depends_on:
- db
- etherpad
- back
- front
networks:
- app-network
front:
build:
context: ..
dockerfile: dockerfiles/front/Dockerfile
ports:
- "5000:5000"
- "5080:80"
- "80:80"
volumes:
- ../doodlestudent/front:/app
environment:

View File

@@ -13,12 +13,8 @@ RUN npx ng build
FROM nginx:alpine
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
CMD ["nginx", "-g", "daemon off;"]
#docker build -f dockerfiles/front/Dockerfile -t front_image .
#docker run --rm -p8080:80 front_image
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -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;"]

View File

@@ -1,6 +1,3 @@
##########################
## FRONTEND + API
##########################
server {
listen 80;
listen [::]:80;
@@ -10,7 +7,7 @@ server {
index index.html;
##########################
# Proxy API requests to the back service
# API
##########################
location /api/ {
proxy_pass http://back:8080;
@@ -19,57 +16,23 @@ server {
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 "";
}
##########################
# FrontEnd returns
# Etherpad (optionnel)
##########################
location / {
proxy_pass http://front:5080;
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;
location /pad/ {
proxy_pass http://etherpad:9001/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
}
}
##########################
# Front Angular
##########################
location / {
try_files $uri $uri/ /index.html;
}
}