Skip to content

Dockerize attempts #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions modules/cli-wrapper/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM maven:3.9.9-eclipse-temurin-21 AS DEPENDENCIES
WORKDIR /app
COPY pom.xml .
COPY modules/cli-wrapper/pom.xml modules/cli-wrapper/pom.xml
COPY modules/core/pom.xml modules/core/pom.xml
COPY modules/rest-api/pom.xml modules/rest-api/pom.xml
COPY modules/webapp/pom.xml modules/webapp/pom.xml

RUN mvn dependency:go-offline -B -e -DskipTests -DexcludeArtifactsIds=podo-generator-core

FROM maven:3.9.9-eclipse-temurin-21 AS BUILDER
LABEL authors="gpspatacean"

WORKDIR /app
COPY --from=DEPENDENCIES /root/.m2 /root/.m2
COPY pom.xml .
COPY modules modules

RUN mvn clean package -pl modules/cli-wrapper -am -B -e -DskipTests

FROM eclipse-temurin:21-jre
WORKDIR /app
COPY --from=BUILDER /app/modules/cli-wrapper/target/*.jar /app/app.jar

ENTRYPOINT ["java", "-jar", "/app/app.jar"]
27 changes: 27 additions & 0 deletions modules/rest-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM maven:3.9.9-eclipse-temurin-21 AS DEPENDENCIES
WORKDIR /app
COPY pom.xml .
COPY modules/cli-wrapper/pom.xml modules/cli-wrapper/pom.xml
COPY modules/core/pom.xml modules/core/pom.xml
COPY modules/rest-api/pom.xml modules/rest-api/pom.xml
COPY modules/webapp/pom.xml modules/webapp/pom.xml

RUN mvn dependency:go-offline -B -e -DskipTests -DexcludeArtifactsIds=podo-generator-core

FROM maven:3.9.9-eclipse-temurin-21 AS BUILDER
LABEL authors="gpspatacean"

WORKDIR /app
COPY --from=DEPENDENCIES /root/.m2 /root/.m2
COPY pom.xml .
COPY modules modules

RUN mvn clean package -pl modules/rest-api -am -B -e -DskipTests

FROM eclipse-temurin:21-jre
WORKDIR /app
COPY --from=BUILDER /app/modules/rest-api/target/*.jar /app/app.jar

EXPOSE 8080

ENTRYPOINT ["java", "-jar", "/app/app.jar"]
27 changes: 27 additions & 0 deletions modules/webapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM maven:3.9.9-eclipse-temurin-21 AS DEPENDENCIES
WORKDIR /app
COPY pom.xml .
COPY modules/cli-wrapper/pom.xml modules/cli-wrapper/pom.xml
COPY modules/core/pom.xml modules/core/pom.xml
COPY modules/rest-api/pom.xml modules/rest-api/pom.xml
COPY modules/webapp/pom.xml modules/webapp/pom.xml

RUN mvn dependency:go-offline -B -e -DskipTests -DexcludeArtifactsIds=podo-generator-core

FROM maven:3.9.9-eclipse-temurin-21 AS BUILDER
LABEL authors="gpspatacean"

WORKDIR /app
COPY --from=DEPENDENCIES /root/.m2 /root/.m2
COPY pom.xml .
COPY modules modules

RUN mvn clean package -pl modules/webapp -am -B -e -DskipTests

FROM eclipse-temurin:21-jre
WORKDIR /app
COPY --from=BUILDER /app/modules/webapp/target/*.jar /app/app.jar

EXPOSE 8081

ENTRYPOINT ["java", "-jar", "/app/app.jar"]