Files
happy-life-star/web-flowith/docker-compose.yml
T
peanut c77352877d feat: 完成Nacos配置优化和WebSocket集成
主要更新:
1. 统一所有微服务端口配置(19000-19008)
2. 为所有服务创建本地/测试/生产三套环境配置
3. 配置Nacos认证密码(本地:Peanut2817*#, 测试/生产:EmotionMuseum2025)
4. 优化网关路由配置,支持负载均衡和WebSocket
5. 新增emotion-websocket模块,支持实时聊天
6. 前端集成WebSocket,替代HTTP轮询
7. 添加配置验证和管理工具脚本

技术特性:
- 完整的环境隔离和服务发现
- WebSocket实时通信支持
- 负载均衡路由配置
- 跨域和安全配置
- 自动重连和心跳检测
2025-07-17 18:10:45 +08:00

57 lines
1.3 KiB
YAML

version: '3.8'
services:
# 开心APP前端服务
emotion-museum-web:
build:
context: .
dockerfile: Dockerfile
target: production
container_name: emotion-museum-web
ports:
- "3000:80"
environment:
- NODE_ENV=production
volumes:
# 如果需要挂载配置文件
- ./nginx.conf:/etc/nginx/nginx.conf:ro
networks:
- emotion-museum-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
labels:
- "traefik.enable=true"
- "traefik.http.routers.emotion-web.rule=Host(`localhost`)"
- "traefik.http.services.emotion-web.loadbalancer.server.port=80"
# 开发模式服务(可选)
emotion-museum-web-dev:
image: node:18-alpine
container_name: emotion-museum-web-dev
working_dir: /app
ports:
- "3001:3000"
environment:
- NODE_ENV=development
volumes:
- .:/app
- /app/node_modules
command: sh -c "npm install && npm run dev"
networks:
- emotion-museum-network
profiles:
- dev
networks:
emotion-museum-network:
driver: bridge
name: emotion-museum-network
volumes:
node_modules: