fix: restore api proxy for Coolify, remove ports, use expose

This commit is contained in:
Admin
2026-05-27 15:25:42 +05:00
parent 5b2efc431f
commit d690546f0e
2 changed files with 13 additions and 4 deletions
+4 -4
View File
@@ -1,8 +1,8 @@
services:
backend:
build: ./backend
ports:
- "${BACKEND_PORT:-3001}:3001"
expose:
- 3001
env_file:
- .env
environment:
@@ -14,8 +14,8 @@ services:
context: ./frontend
args:
- VITE_API_URL=/api
ports:
- "${FRONTEND_PORT:-8080}:80"
expose:
- 80
depends_on:
- backend
restart: unless-stopped
+9
View File
@@ -7,4 +7,13 @@ server {
location / {
try_files $uri $uri/ /index.html;
}
location /api/ {
proxy_pass http://backend:3001/api/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}