feat: add multi-stage Dockerfile for full build with martial-tool
- Add Dockerfile.fullbuild: multi-stage build that compiles martial-tool - Rename Dockerfile to Dockerfile.quick for quick builds (pre-built jar) - Update docker-compose.yml to use parent directory context - Update README with new deployment instructions
This commit is contained in:
24
Dockerfile.quick
Normal file
24
Dockerfile.quick
Normal file
@@ -0,0 +1,24 @@
|
||||
# 运行阶段:使用轻量级 JRE 镜像
|
||||
FROM eclipse-temurin:17-jre-jammy
|
||||
|
||||
LABEL maintainer="JohnSion"
|
||||
LABEL description="武术比赛管理系统后端服务"
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 复制编译好的 JAR 文件
|
||||
COPY target/blade-api.jar /app/blade-api.jar
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 8123
|
||||
|
||||
# 健康检查
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=60s --retries=3 \
|
||||
CMD curl -f http://localhost:8123/actuator/health || exit 1
|
||||
|
||||
# JVM 参数配置
|
||||
ENV JAVA_OPTS="-Xms512m -Xmx1024m -XX:+UseG1GC"
|
||||
ENV SPRING_PROFILE="dev"
|
||||
|
||||
# 启动命令
|
||||
CMD ["sh", "-c", "java ${JAVA_OPTS} -jar /app/blade-api.jar --spring.profiles.active=${SPRING_PROFILE}"]
|
||||
Reference in New Issue
Block a user