mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:35:50 +00:00
Multistage build
This commit is contained in:
parent
54f81c4b12
commit
147a8b4893
2 changed files with 6 additions and 7 deletions
3
.github/workflows/multi-job.yaml
vendored
3
.github/workflows/multi-job.yaml
vendored
|
@ -39,9 +39,6 @@ jobs:
|
||||||
- name: Make Gradle executable
|
- name: Make Gradle executable
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
|
|
||||||
- name: Build App
|
|
||||||
run: ./gradlew build
|
|
||||||
|
|
||||||
docker_push:
|
docker_push:
|
||||||
name: Push to Docker Hub
|
name: Push to Docker Hub
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
10
Dockerfile
10
Dockerfile
|
@ -1,8 +1,10 @@
|
||||||
FROM openjdk:17-jdk-slim
|
FROM gradle:8.10.2-jdk17 AS build
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY build/libs/*.jar app.jar
|
COPY . .
|
||||||
|
RUN gradle build --no-daemon
|
||||||
|
|
||||||
|
FROM eclipse-temurin:17-jdk
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=build /app/build/libs/*.jar app.jar
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
ENTRYPOINT ["java", "-jar", "app.jar"]
|
ENTRYPOINT ["java", "-jar", "app.jar"]
|
||||||
|
|
Loading…
Reference in a new issue