improvement: a port issue for local dev fixed.

This commit is contained in:
2026-05-03 20:29:58 +03:30
parent 5682da87aa
commit 4c61885cef
3 changed files with 58 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev -p 3000",
"dev": "next dev -p 3001",
"build": "next build",
"start": "next start -p 3000",
"lint": "next lint"

View File

@@ -34,7 +34,7 @@ services:
- ../backend/.env
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-dyolink_dev_change_me}@postgres:5432/${POSTGRES_DB:-dyolink_db}
- FRONTEND_URL=http://frontend:3000
- FRONTEND_URL=http://localhost:4000
- PORT=3000
ports:
- "4001:3000"
@@ -56,9 +56,8 @@ services:
environment:
- NEXT_PUBLIC_API_URL=http://localhost:4001/api
- NEXT_PUBLIC_APP_URL=http://localhost:4000
- PORT=3000
ports:
- "4000:3000"
- "4000:3001"
volumes:
- ../frontend:/app:rw
- /app/node_modules
@@ -77,6 +76,7 @@ services:
ports:
- "8080:80"
volumes:
- ./nginx/http-only.dev.conf:/etc/nginx/conf.d/default.conf:ro
- ./logs/nginx:/var/log/nginx
networks:
- dyolink_network

View File

@@ -0,0 +1,54 @@
# Dev docker-compose only: local `npm run dev` uses port 3001 (see frontend package.json).
# Staging / registry stacks use http-only.conf (frontend:3000).
upstream dyolink_backend {
server backend:3000;
keepalive 32;
}
upstream dyolink_frontend {
server frontend:3001;
keepalive 32;
}
server {
listen 80;
listen [::]:80;
server_name _;
client_max_body_size 50M;
location / {
proxy_pass http://dyolink_frontend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
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_cache_bypass $http_upgrade;
proxy_read_timeout 300;
proxy_connect_timeout 300;
}
location /api {
proxy_pass http://dyolink_backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
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_cache_bypass $http_upgrade;
proxy_read_timeout 300;
proxy_connect_timeout 300;
}
location /health {
access_log off;
return 200 "healthy\n";
add_header Content-Type text/plain;
}
}