# ai-service Dockerfile
FROM openjdk:17-jre-slim

WORKDIR /app

# 复制依赖
COPY target/lib ./lib
COPY target/classes ./classes
COPY src/main/resources ./resources

# 环境变量
ENV JAVA_OPTS="-Xms256m -Xmx512m -XX:+UseG1GC"

# 健康检查
HEALTHCHECK --interval=30s --timeout=10s --retries=3 CMD wget -q --spider http://localhost:8087/actuator/health || exit 1

EXPOSE 8087

ENTRYPOINT ["sh", "-c", "java ${JAVA_OPTS} -cp .:classes:resources:lib org.springframework.boot.loader.JarLauncher"]
