From 38ec1a6a71cc6b21b7a5e0bd1832a77cad73ae21 Mon Sep 17 00:00:00 2001 From: TangHuan Date: Wed, 2 Apr 2025 13:46:07 +0800 Subject: [PATCH] init-cicd-build --- .gitea/workflows/dev.yaml | 10 +++------- Dockerfile | 9 +++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 Dockerfile diff --git a/.gitea/workflows/dev.yaml b/.gitea/workflows/dev.yaml index e4a02e8..f0439a6 100644 --- a/.gitea/workflows/dev.yaml +++ b/.gitea/workflows/dev.yaml @@ -32,11 +32,7 @@ jobs: - name: 编译 run: chmod +x ./mvnw && ./mvnw -s settings.xml -B -Ptrydo -Phuawei clean install -U -DskipTests -Pprod - - name: 打包 - run: ./mvnw spring-boot:build-image-no-fork + - run: mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar) + - name: 打包Docker + run: docker build -t ccr.ccs.tencentyun.com/jqyt/biz-dev:1.0.0 - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ gitea.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cac386b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM openjdk:17 + +RUN addgroup -S spring && adduser -S spring -G spring +USER spring:spring +ARG DEPENDENCY=target/dependency +COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib +COPY ${DEPENDENCY}/META-INF /app/META-INF +COPY ${DEPENDENCY}/BOOT-INF/classes /app +ENTRYPOINT ["java","-cp","app:app/lib/*","net.thday.cesidemococd.CesiDemoCocdApplication"]