services: backend: build: context: . dockerfile: Dockerfile.backend ports: - "8080:8080" volumes: - csp_data:/data restart: unless-stopped frontend: build: context: . dockerfile: Dockerfile.frontend environment: # 前端调用后端API时使用;后续页面会读取该变量 - NEXT_PUBLIC_API_BASE=http://localhost:8080 ports: - "3000:3000" depends_on: - backend restart: unless-stopped volumes: csp_data: