feat: 创建 Spring Boot 4 项目及 Gitea/GitLab CI/CD 流水线
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled
This commit is contained in:
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
||||
FROM maven:3.9-eclipse-temurin-21 AS builder
|
||||
WORKDIR /workspace
|
||||
COPY .mvn .mvn
|
||||
COPY mvnw pom.xml ./
|
||||
COPY src src
|
||||
RUN ./mvnw -B clean verify
|
||||
|
||||
FROM eclipse-temurin:21-jre AS runtime
|
||||
WORKDIR /app
|
||||
RUN groupadd --system app && useradd --system --gid app app
|
||||
COPY --from=builder /workspace/target/springboot-cici-demo-0.0.1-SNAPSHOT.jar /app/app.jar
|
||||
USER app
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["java", "-jar", "/app/app.jar"]
|
||||
Reference in New Issue
Block a user