Updated Dockerfile
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Sambo Chea 2022-04-21 17:53:00 +07:00
parent 9b7a1159f5
commit fd8942b3b7
Signed by: sombochea
GPG Key ID: 3C7CF22A05D95490

View File

@ -1,16 +1,38 @@
FROM cubetiq/calpine-openjdk11:latest # Builder
FROM cubetiq/openjdk:11u-ubuntu as builder
LABEL maintainer="sombochea@cubetiqs.com" LABEL maintainer="sombochea@cubetiqs.com"
# Working directory for application WORKDIR /app
RUN apt-get update && apt-get install -y git
COPY . .
RUN sh gradlew clean bootJar
# Build for container image
FROM cubetiq/openjdk:jre-11u-debian
LABEL maintainer="sombochea@cubetiqs.com"
# Setup timezone to Phnom Penh
RUN ln -sf /usr/share/zoneinfo/Asia/Phnom_Penh /etc/localtime
RUN echo "Asia/Phnom_Penh" > /etc/timezone
# App root path
WORKDIR /opt/cubetiq WORKDIR /opt/cubetiq
# Define mount volumn for data path # App volumn
VOLUME ["/opt/cubetiq/data"] VOLUME ["/opt/cubetiq", "/data"]
# Copy build source to container # Clinic Api Module Build Directory
COPY api/build/libs/*.jar ./api.jar ARG CLINIC_API_BUILD_DIR=api/build
ENV APP_DATA_DIR "/opt/cubetiq/data" # Copy the app bundle to the workdir
COPY --from=builder /app/${CLINIC_API_BUILD_DIR}/libs/*.jar ./api.jar
# App profile will run with
ENV PROFILE=dev
ENV APP_DATA_DIR=/data
# Entrypoint to app # Entrypoint to app
CMD ["java","-jar", "./api.jar"] CMD ["java","-jar", "./api.jar"]