Skip to content

Commit

Permalink
Dockerize backend
Browse files Browse the repository at this point in the history
  • Loading branch information
davafons committed Jan 2, 2024
1 parent 9661931 commit 8dae2fb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
10 changes: 10 additions & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*
!build/libs/dependency/BOOT-INF/lib
!build/libs/dependency/BOOT-INF/classes
!build/libs/dependency/META-INF

!gradlew
!gradle
!build.gradle
!settings.gradle
!src/main
12 changes: 12 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM openjdk:17-jdk-alpine as build
WORKDIR /workspace/app

COPY gradle gradle
COPY build.gradle settings.gradle gradlew ./
COPY src src

RUN ./gradlew build -x test

FROM openjdk:17-jdk-alpine
COPY --from=build /workspace/app/build/libs/nadelog-0.0.1-SNAPSHOT.jar app.jar
ENTRYPOINT ["java","-jar","app.jar"]
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@RestController
public class TestController {

private static final String template = "Hello, %s!";
private static final String template = "Greetings, %s!";
private final AtomicLong counter = new AtomicLong();

@GetMapping("/test")
Expand Down

0 comments on commit 8dae2fb

Please sign in to comment.