File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 cache : maven
2323 distribution : corretto
2424 - name : Maven Build
25- run : ./mvnw spring-boot:build-image -DimageName=registry.digitalocean.com/davisellwoodwebsite/website:latest
25+ run : ./mvnw install --no-transfer-progress
26+ - name : tag docker image
27+ run :
28+ docker tag davisellwood/website:latest registry.digitalocean.com/davisellwood/website:latest
2629 - name : Install doctl
2730 uses : digitalocean/action-doctl@v2
2831 with :
3235 doctl registry login
3336 - name : docker push
3437 run :
35- docker push registry.digitalocean.com/davisellwoodwebsite /website:latest
38+ docker push registry.digitalocean.com/davisellwood /website:latest
Original file line number Diff line number Diff line change 1+ # Use the base image that your Spring Boot app uses
2+ FROM openjdk:17-jdk-slim
3+
4+ # Copy the application JAR file into the container
5+ COPY target/website-*.jar /website.jar
6+
7+ # Install libgcc (or any other libraries you need)
8+ RUN apt-get update && apt-get install -y libgcc1
9+
10+ # Expose the port the app will run on
11+ EXPOSE 8080
12+
13+ # Run the Spring Boot app
14+ ENTRYPOINT ["java" , "-jar" , "/website.jar" ]
Original file line number Diff line number Diff line change 279279 </configuration >
280280 </plugin >
281281 <plugin >
282- <groupId >org.springframework.boot</groupId >
283- <artifactId >spring-boot-maven-plugin</artifactId >
282+ <groupId >com.spotify</groupId >
283+ <artifactId >dockerfile-maven-plugin</artifactId >
284+ <version >1.4.13</version >
285+ <executions >
286+ <execution >
287+ <goals >
288+ <goal >build</goal >
289+ </goals >
290+ </execution >
291+ </executions >
284292 <configuration >
285- <excludes >
286- <exclude >
287- <groupId >org.projectlombok</groupId >
288- <artifactId >lombok</artifactId >
289- </exclude >
290- </excludes >
291- <image >
292- <name >${imageName} </name >
293- </image >
293+ <repository >davisellwood/website</repository >
294+ <tag >latest</tag >
295+ <buildArgs >
296+ <JAR_FILE >target/${project.build.finalName} .jar</JAR_FILE >
297+ </buildArgs >
294298 </configuration >
295299 </plugin >
296300 </plugins >
You can’t perform that action at this time.
0 commit comments