🔧 build(deploy): frontend 容器内端口 80→8000——避免占用宿主 80
- deploy/Dockerfile.frontend EXPOSE 80 → 8000
- deploy/nginx/frontend.conf listen 80 → 8000
- docker-compose.yml frontend ports "${FRONTEND_PORT:-10003}:80" → ":8000"
容器内端口统一 8000 系列(backend=8000、inventory=8001、frontend=8000),
frontend 不再抢占 80(留给外层 nginx/监控);1024+ 无需 root 权限。
宿主机端口(10003)保持不变。
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,8 @@ COPY frontend/ ./
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:1.27-alpine
|
||||
# 注意:容器内 nginx listen 改为 8000(避免占用宿主 80;1024+ 无 root 限制)
|
||||
COPY deploy/nginx/frontend.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build /app/frontend/dist /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 8000
|
||||
|
||||
@@ -3,7 +3,7 @@ upstream gemold_backend_upstream {
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen 8000;
|
||||
server_name _;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
+2
-2
@@ -61,8 +61,8 @@ services:
|
||||
image: gemold-frontend:latest
|
||||
container_name: gemold_frontend
|
||||
ports:
|
||||
# 浏览器入口端口(默认 10003;容器内 nginx 仍监听 80,反代到 backend 8000)
|
||||
- "${FRONTEND_PORT:-10003}:80"
|
||||
# 浏览器入口端口(默认 10003);容器内 nginx 监听 8000 反代到 backend 8000
|
||||
- "${FRONTEND_PORT:-10003}:8000"
|
||||
depends_on:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
|
||||
Reference in New Issue
Block a user