Skip to content

Instantly share code, notes, and snippets.

@isaacssemugenyi
Created October 27, 2023 14:58
Show Gist options
  • Save isaacssemugenyi/69e379b095501bd10875dc1cd4bc975e to your computer and use it in GitHub Desktop.
Save isaacssemugenyi/69e379b095501bd10875dc1cd4bc975e to your computer and use it in GitHub Desktop.
Full docker file for java springboot application
FROM maven:3.8.5-openjdk-17 as builder
WORKDIR /app
COPY pom.xml .
RUN mvn dependency:go-offline
COPY src/ ./src/
RUN mvn clean package -DskipTests=true
FROM eclipse-temurin:17-jdk-alpine as prod
RUN mkdir /app
COPY --from=builder /app/target/*.jar /app/app.jar
ENV SERVER_PORT=6060
WORKDIR /app
EXPOSE 6060
ENTRYPOINT ["java","-jar","/app.jar"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment