refactor(docker): update nginx port and simplify docker-compose config
This commit is contained in:
@@ -1,28 +1,15 @@
|
||||
version: '3.8'
|
||||
|
||||
networks:
|
||||
proxy-net:
|
||||
external: true # 使用已存在的 proxy-net 网络
|
||||
|
||||
services:
|
||||
teres-frontend:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: production
|
||||
teres_web_frontend:
|
||||
image: ${TE_FE_IMAGE_NAME}
|
||||
container_name: teres_web_frontend
|
||||
networks:
|
||||
- proxy-net # 加入 NPM 的网络
|
||||
ports:
|
||||
- "3000:80"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
restart: unless-stopped
|
||||
|
||||
# 开发环境服务(可选)
|
||||
teres-frontend-dev:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.dev
|
||||
ports:
|
||||
- "5173:5173"
|
||||
volumes:
|
||||
- .:/app
|
||||
- /app/node_modules
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
profiles:
|
||||
- dev
|
||||
- "5173:80" # 将容器内的80端口映射到主机的5173端口
|
||||
restart: unless-stopped
|
||||
Reference in New Issue
Block a user