Files

21 lines
845 B
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.
# UserBase 后端镜像(基于已构建好的 target/app.jar,CI 已把 maven 产物 cp 成固定名)
# 构建上下文 = service 目录: 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/app.jar /app/app.jar
# 镜像内 application-prod.yml 即生产配置基准(nacos 已停用),
# 启动由 run-app.sh 以 application-prod.yml + 环境变量注入完成。
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 8060
ENTRYPOINT ["/app/run-app.sh"]