merge projman re-injected files (Dockerfile 10002 + build.yml network option)
build / build-push (push) Successful in 2m15s
build / build-push (push) Successful in 2m15s
This commit is contained in:
@@ -22,6 +22,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: docker:24
|
image: docker:24
|
||||||
|
options: --network infra-infra-net
|
||||||
steps:
|
steps:
|
||||||
- name: 安装 git / curl(alpine)
|
- name: 安装 git / curl(alpine)
|
||||||
run: apk add --no-cache git curl
|
run: apk add --no-cache git curl
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ git add -A
|
|||||||
git commit -m "init local code"
|
git commit -m "init local code"
|
||||||
|
|
||||||
# 4. 关联远程仓库(幂等:已存在 origin 则改地址,不报错)
|
# 4. 关联远程仓库(幂等:已存在 origin 则改地址,不报错)
|
||||||
git remote add origin http://gitea:3000/notice/NoticeService.git 2>/dev/null \
|
git remote add origin http://gitea.yunhaixingtong.com/notice/NoticeService.git 2>/dev/null \
|
||||||
|| git remote set-url origin http://gitea:3000/notice/NoticeService.git
|
|| git remote set-url origin http://gitea.yunhaixingtong.com/notice/NoticeService.git
|
||||||
|
|
||||||
# 5. 拉取远程信息(只下载,不合并)
|
# 5. 拉取远程信息(只下载,不合并)
|
||||||
git fetch origin
|
git fetch origin
|
||||||
|
|||||||
+8
-10
@@ -1,5 +1,8 @@
|
|||||||
# Notice 后端镜像(基于 mvn package 产出的 target/notice.jar)
|
# 由 projman 注入的 Spring Boot 运行镜像(单阶段,jar 预构建)
|
||||||
# 构建上下文 = service 目录: docker build -f service/docker/Dockerfile -t <img> service
|
# CI 已先 mvn package,并在容器内把产物 cp 成固定名 target/app.jar
|
||||||
|
# 构建上下文 = 仓库根:docker build -f docker/Dockerfile .
|
||||||
|
# 健康检查依赖 curl(projman 部署用 curl 探 /actuator/health)——应用需含 spring-boot-starter-actuator
|
||||||
|
# 时区 Asia/Shanghai;JAVA_OPTS 由 projman 部署 env 注入(默认 -Xms512m -Xmx1024m)
|
||||||
FROM eclipse-temurin:8-jre
|
FROM eclipse-temurin:8-jre
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
@@ -9,12 +12,7 @@ RUN apt-get update \
|
|||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY target/app.jar /app/notice.jar
|
COPY target/app.jar /app/app.jar
|
||||||
# 镜像内 application-prod.yml 仅作「nacos 不可达时的兜底默认」;
|
|
||||||
# 正常启动由 bootstrap.yml 从 nacos 拉取线上配置(group=NOTICE, dataId=notice.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 8070
|
EXPOSE 10002
|
||||||
ENTRYPOINT ["/app/run-app.sh"]
|
ENTRYPOINT ["sh", "-c", "java ${JAVA_OPTS:--Xms512m -Xmx1024m} -Dfile.encoding=UTF-8 -jar /app/app.jar"]
|
||||||
|
|||||||
Reference in New Issue
Block a user