Files
UserclassService/docker/Dockerfile
T
2026-08-13 10:01:44 +08:00

21 lines
869 B
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.
# BschClass 后端镜像(基于已构建好的 target/BschClass-0.1.jar)
# 构建上下文 = 仓库根目录: docker build -f docker/Dockerfile -t <img> .
FROM eclipse-temurin:8-jre
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl tzdata \
&& ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY target/BschClass-0.1.jar /app/BschClass-0.1.jar
# 镜像内 application-prod.yml 仅作「nacos 不可达时的兜底默认」;
# 正常启动由 run-app.sh 从 nacos 拉取线上配置(dataId=bschclassmanage-prod.yaml)后覆盖。
COPY docker/application-prod.yml /app/config/application-prod.yml
COPY docker/run-app.sh /app/run-app.sh
RUN chmod +x /app/run-app.sh && mkdir -p /data/upload
EXPOSE 8087
ENTRYPOINT ["/app/run-app.sh"]