services: backend: build: context: . dockerfile: Dockerfile.backend ports: - "8080:8080" volumes: - csp_data:/data restart: unless-stopped frontend: build: context: . dockerfile: Dockerfile.frontend environment: # 浏览器侧请求后端的公共地址(本机测试用 localhost) - NEXT_PUBLIC_API_BASE=http://localhost:8080 # Next.js 服务端反代用(可选),仅在你把 NEXT_PUBLIC_API_BASE 设为 /api 时需要 - BACKEND_INTERNAL_URL=http://backend:8080 ports: - "3000:3000" depends_on: - backend restart: unless-stopped volumes: csp_data: