Files
schoolNews/docker/Dockerfile.serv
2025-11-24 13:36:03 +08:00

31 lines
1.0 KiB
Docker
Raw 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.

# ====================================
# 后端服务镜像 - School News Serv
# 基于school-news-base-serv已包含Python依赖
# 注意jar包需要在主机中先编译好
# ====================================
FROM school-news-base-serv:latest
# 从主机复制已编译的jar包
COPY schoolNewsServ/admin/target/admin-1.0.0.jar /app/app.jar
# 复制爬虫脚本(基础镜像已安装依赖,这里只需复制脚本)
COPY schoolNewsCrawler/ /app/crawler/
# 复制默认配置文件(作为备份)
COPY schoolNewsServ/admin/src/main/resources/application.yml /app/config/application.yml.template
COPY schoolNewsServ/admin/src/main/resources/log4j2-spring.xml /app/config/log4j2-spring.xml.template
# 复制启动脚本
COPY schoolNewsServ/docker/start.sh /app/start.sh
RUN chmod +x /app/start.sh
# 暴露端口
EXPOSE 8081
# 健康检查
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8081/schoolNewsServ/actuator/health || exit 1
# 启动应用
CMD ["/app/start.sh"]