Skip to content

Commit

Permalink
spring boot - dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
while1618 committed Dec 23, 2023
1 parent fdeff31 commit c7bcb1c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
16 changes: 14 additions & 2 deletions backend/spring-boot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
FROM maven:3.9.6-amazoncorretto-17-debian AS build

WORKDIR /app

COPY pom.xml .
COPY src ./src

RUN mvn clean install -DskipTests

FROM openjdk:17-jdk-slim
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} bootstrapbugz-api.jar

WORKDIR /app

COPY --from=build /app/target/*.jar bootstrapbugz-api.jar

ENTRYPOINT ["java", "-Dspring.profiles.active=dev", "-jar", "bootstrapbugz-api.jar"]
9 changes: 3 additions & 6 deletions backend/spring-boot/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# API

To start the backend via docker you need to run `mvn clean install` and after that `docker compose build bootstrapbugz-api`.
To start the backend via docker you need to run `docker-compose up --build -d`.

Then run `docker-compose up -d`

and you'll find backend on http://localhost:8081/

You can find OpenApi documentation here: http://localhost:8081/swagger-ui/index.html
You'll find backend running on http://localhost:8081/
And OpenApi documentation here: http://localhost:8081/swagger-ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.HashSet;
import java.util.Set;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down Expand Up @@ -77,7 +76,7 @@ public class User implements Serializable {
joinColumns = @JoinColumn(name = "user_id"),
inverseJoinColumns = @JoinColumn(name = "role_id"))
@Column(nullable = false)
private Set<Role> roles = new HashSet<>();
private Set<Role> roles;

@Override
public boolean equals(Object o) {
Expand Down

0 comments on commit c7bcb1c

Please sign in to comment.