fix: 修改前端生产构建方案

This commit is contained in:
tim
2025-09-30 13:51:43 +08:00
parent 7ce5de7f7c
commit d00dbbbd03
4 changed files with 47 additions and 87 deletions

View File

@@ -212,29 +212,24 @@ services:
profiles:
- dev
frontend_service:
frontend_service:
build:
context: ..
dockerfile: frontend-service.Dockerfile
container_name: openisle-frontend-service
working_dir: /app
context: .. # 仓库根目录(包含 frontend_nuxt/
dockerfile: docker/frontend-service.Dockerfile
args:
# 由 .env或 --env-file提供默认 staging正式环境脚本会传 production
NUXT_ENV: ${NUXT_ENV:-staging}
container_name: openisle-frontend
env_file:
- ../.env
volumes:
- ../frontend_nuxt:/app
- frontend-service-node-modules:/app/node_modules
- frontend-static:/var/www/openisle
- ../.env # 或者在脚本里指定 .env.staging / .env.production
ports:
- "${FRONTEND_SERVICE_PORT:-3001}:3000"
- "${FRONTEND_PORT:-3000}:3000"
depends_on:
springboot:
condition: service_healthy
websocket-service:
condition: service_healthy
networks:
- openisle-network
profiles:
- service
restart: unless-stopped
loopback_8080:
image: alpine/socat