version: '3.8' services: app: build: context: . dockerfile: Dockerfile container_name: yunzhu-navigation ports: - "8888:8888" # 前端端口 - "8889:8889" # 后端端口 volumes: # 挂载源代码目录以实现热重载(开发环境) - .:/app # 排除 node_modules,使用容器内的版本 - /app/node_modules environment: - NODE_ENV=development - PORT=8889 restart: unless-stopped stdin_open: true tty: true