improvement: a port issue for local dev fixed.
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 3000",
|
"dev": "next dev -p 3001",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start -p 3000",
|
"start": "next start -p 3000",
|
||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ services:
|
|||||||
- ../backend/.env
|
- ../backend/.env
|
||||||
environment:
|
environment:
|
||||||
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-dyolink_dev_change_me}@postgres:5432/${POSTGRES_DB:-dyolink_db}
|
- 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
|
- PORT=3000
|
||||||
ports:
|
ports:
|
||||||
- "4001:3000"
|
- "4001:3000"
|
||||||
@@ -56,9 +56,8 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- NEXT_PUBLIC_API_URL=http://localhost:4001/api
|
- NEXT_PUBLIC_API_URL=http://localhost:4001/api
|
||||||
- NEXT_PUBLIC_APP_URL=http://localhost:4000
|
- NEXT_PUBLIC_APP_URL=http://localhost:4000
|
||||||
- PORT=3000
|
|
||||||
ports:
|
ports:
|
||||||
- "4000:3000"
|
- "4000:3001"
|
||||||
volumes:
|
volumes:
|
||||||
- ../frontend:/app:rw
|
- ../frontend:/app:rw
|
||||||
- /app/node_modules
|
- /app/node_modules
|
||||||
@@ -77,6 +76,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "8080:80"
|
- "8080:80"
|
||||||
volumes:
|
volumes:
|
||||||
|
- ./nginx/http-only.dev.conf:/etc/nginx/conf.d/default.conf:ro
|
||||||
- ./logs/nginx:/var/log/nginx
|
- ./logs/nginx:/var/log/nginx
|
||||||
networks:
|
networks:
|
||||||
- dyolink_network
|
- dyolink_network
|
||||||
|
|||||||
54
infrastructure/nginx/http-only.dev.conf
Normal file
54
infrastructure/nginx/http-only.dev.conf
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user