refactor: consolidate public-web port to 8080 and add API proxy configuration

Remove backend port exposure and change public-web from port 8082 to 8080. Add backend dependency to public-web service. Remove public-web dependency from nginx service. Add /api/ location block to public-web nginx config with proxy_pass to backend:8080 and proxy headers for Host, X-Real-IP, X-Forwarded-For and X-Forwarded-Proto.
This commit is contained in:
2026-03-17 22:13:46 +01:00
parent 65e74c6832
commit 1d69b20fcc
2 changed files with 11 additions and 4 deletions

View File

@@ -23,8 +23,6 @@ services:
- .env
depends_on:
- postgres
ports:
- "8080:8080"
networks:
control:
aliases:
@@ -48,8 +46,10 @@ services:
build:
context: ..
dockerfile: public-web/Dockerfile
depends_on:
- backend
ports:
- "8082:80"
- "8080:80"
networks:
- control
@@ -58,7 +58,6 @@ services:
depends_on:
- backend
- admin-web
- public-web
ports:
- "80:80"
volumes:

View File

@@ -4,6 +4,14 @@ server {
root /usr/share/nginx/html;
index index.html;
location /api/ {
proxy_pass http://backend:8080;
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;
}
location / {
try_files $uri /index.html;
}