spring-web-modules/Dockerfile

39 lines
854 B
Docker
Raw Normal View History

2022-04-21 17:53:00 +07:00
# Builder
FROM cubetiq/openjdk:11u-ubuntu as builder
2021-05-18 10:44:05 +07:00
LABEL maintainer="sombochea@cubetiqs.com"
2022-04-21 17:53:00 +07:00
WORKDIR /app
RUN apt-get update && apt-get install -y git
COPY . .
RUN sh gradlew clean bootJar
2022-10-03 12:26:49 +07:00
RUN rm -f build/libs/*-plain.jar
2022-04-21 17:53:00 +07:00
# 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
2021-05-18 10:44:05 +07:00
WORKDIR /opt/cubetiq
2022-04-21 17:53:00 +07:00
# App volumn
VOLUME ["/opt/cubetiq", "/data"]
2022-10-03 12:26:49 +07:00
# Api Module Build Directory
ARG API_BUILD_DIR=api/build
2021-05-18 10:44:05 +07:00
2022-04-21 17:53:00 +07:00
# Copy the app bundle to the workdir
2022-10-03 13:00:04 +07:00
COPY --from=builder /app/${API_BUILD_DIR}/libs/api-0.0.1-SNAPSHOT.jar ./api.jar
2021-05-18 10:44:05 +07:00
2022-04-21 17:53:00 +07:00
# App profile will run with
ENV PROFILE=dev
ENV APP_DATA_DIR=/data
2021-05-18 10:44:05 +07:00
# Entrypoint to app
CMD ["java","-jar", "./api.jar"]