🚀 PIG AI 新版来袭:AI能力全面升级! 点击了解一下?
将 Spring AI 应用程序部署到云平台的指南
# application-aws.yml spring: ai: aws: region: us-west-2 credentials: access-key: ${AWS_ACCESS_KEY} secret-key: ${AWS_SECRET_KEY}
# application-azure.yml spring: ai: azure: endpoint: ${AZURE_ENDPOINT} api-key: ${AZURE_API_KEY}
# application-gcp.yml spring: ai: google: project-id: ${GCP_PROJECT_ID} credentials: ${GOOGLE_APPLICATION_CREDENTIALS}
FROM openjdk:17-jdk-slim COPY target/*.jar app.jar ENTRYPOINT ["java","-jar","/app.jar"]
# serverless.yml service: spring-ai-app provider: name: aws runtime: java17 functions: api: handler: com.example.AiApplication events: - http: path: /api method: any
@Configuration public class CloudConfig { @Bean public CloudProperties cloudProperties() { return CloudProperties.builder() .withRegion(System.getenv("CLOUD_REGION")) .withCredentials(new CloudCredentials()) .withMonitoring(true) .build(); } }