version: '3' services: log-server: ports: - "3006:3006" # 将容器的 3000 端口映射到主机的 3000 端口 container_name: log-server image: log-server:v20250212 environment: - NODE_ENV=production #volumes: #- ./server.js://usr/src/app/server.js deploy: resources: limits: cpus: "1.0" # 每个容器最多使用 1 个 CPU 核心 memory: 1G # 每个容器最多使用 1GB 内存 restart: always # 容器崩溃后自动重启