-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (28 loc) · 1.16 KB
/
Dockerfile
File metadata and controls
36 lines (28 loc) · 1.16 KB
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
29
30
31
32
33
34
35
36
FROM openjdk:8-jdk-alpine AS build
LABEL maintainer="Natanael Copa <ncopa@alpinelinux.org>"
RUN apk add --update busybox-suid
WORKDIR /workspace/app
RUN addgroup -S gowtham && adduser -S gowtham -G gowtham
RUN chown -R gowtham:gowtham /workspace/app
COPY gradlew .
COPY gradle gradle
COPY build.gradle .
RUN chmod 777 gradlew
USER gowtham
RUN ./gradlew dependencies
COPY src src
RUN ./gradlew clean build -x test
RUN mkdir -p build/dependency && (cd build/dependency; jar -xf ../libs/*.jar)
FROM openjdk:8-jre-alpine
LABEL maintainer="Natanael Copa <ncopa@alpinelinux.org>"
RUN apk add --update busybox-suid
RUN addgroup -S gowtham && adduser -S gowtham -G gowtham
USER gowtham
VOLUME ["/tmp"]
HEALTHCHECK --interval=5s --timeout=2s --retries=12 CMD curl --silent --fail localhost:2573/userProfileController/status || exit 1
ARG DEPENDENCY=/workspace/app/build/dependency
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java", "-cp", "app:app/lib/*", "com.paddyseedexpert.userprofile.UserProfileApplication"]
EXPOSE 2573