-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (24 loc) · 749 Bytes
/
Dockerfile
File metadata and controls
28 lines (24 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
###
# Build image
###
FROM openjdk:8-jdk-slim as build
WORKDIR /workspace/app
# Copy src files fpr building
COPY mvnw .
COPY .mvn .mvn
COPY pom.xml .
COPY src src
# Make wrapper executable
RUN chmod +x mvnw
# Build app
RUN ./mvnw install -DskipTests
RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar)
###
# Run image
###
FROM openjdk:8-jdk-slim
ARG DEPENDENCY=/workspace/app/target/dependency
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build /workspace/app/target/GraphQL-With-Spring-Boot-*.jar /app/app.jar
ENTRYPOINT ["java", "-cp","app:app/lib/*", "-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n", "-jar","/app/app.jar"]