Files
java-10584/Dockerfile
赵忠林 a1a3d78dd6 feat(generator): 添加代码生成器模板和AI聊天功能
- 新增.gitignore文件配置忽略规则
- 添加Taro页面配置模板add.config.ts.btl
- 添加Taro页面组件模板add.tsx.btl用于动态表单生成
- 实现AiController提供AI聊天消息处理功能
- 集成WebSocket实现AI消息流式传输
- 添加支付宝支付配置工具类AlipayConfigUtil
- 创建支付宝参数实体AlipayParam
- 集成阿里云短信发送工具AliYunSender
- 添加阿里云机器翻译工具AliyunTranslateUtil
- 完善API响应结果包装类ApiResult
- 配置多环境应用参数application.yml
- 添加CMS生产环境配置application-cms.yml
- 添加开发环境配置application-dev.yml
- 添加生产环境配置application-prod.yml
2026-02-13 02:21:21 +08:00

52 lines
1.5 KiB
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 使用更小的 Alpine Linux + OpenJDK 17 镜像
FROM openjdk:17-jdk-alpine
# 设置工作目录
WORKDIR /app
# 创建日志目录
RUN mkdir -p /app/logs
# 创建上传文件目录
RUN mkdir -p /app/uploads
# 安装必要工具和中文字体支持
# fontconfig: 字体配置库
# ttf-dejavu: 包含DejaVu字体支持中文显示
# wqy-zenhei: 文泉驿正黑字体,开源中文字体
RUN apk add --no-cache wget fontconfig ttf-dejavu && \
# 下载并安装文泉驿微米黑字体(更好的中文支持)
wget -O /tmp/wqy-microhei.ttc https://github.com/anthonyfok/fonts-wqy-microhei/raw/master/wqy-microhei.ttc && \
mkdir -p /usr/share/fonts/truetype/wqy && \
mv /tmp/wqy-microhei.ttc /usr/share/fonts/truetype/wqy/ && \
# 刷新字体缓存
fc-cache -fv && \
# 创建应用用户(安全考虑)
addgroup -g 1000 appgroup && \
adduser -D -u 1000 -G appgroup appuser
# 复制jar包到容器
COPY target/*.jar app.jar
# 设置目录权限
RUN chown -R appuser:appgroup /app
# 切换到应用用户
USER appuser
# 暴露端口
EXPOSE 9200
# 设置JVM参数
ENV JAVA_OPTS="-Xms512m -Xmx1024m -Djava.security.egd=file:/dev/./urandom"
# 设置Spring Profile
ENV SPRING_PROFILES_ACTIVE=prod
# 健康检查
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:9200/actuator/health || exit 1
# 启动应用
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]