spring-web-modules/Dockerfile

40 lines
807 B
Docker
Raw Normal View History

2022-04-21 17:53:00 +07:00
# Builder
2023-03-09 18:32:09 +07:00
FROM bellsoft/liberica-openjdk-alpine-musl 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
2023-03-09 18:32:09 +07:00
COPY gradlew ./
COPY gradle ./gradle
RUN ./gradlew
2022-04-21 17:53:00 +07:00
2023-03-09 18:32:09 +07:00
COPY settings.gradle.kts ./
COPY build.gradle.kts ./
COPY api/build.gradle.kts ./api/build.gradle.kts
COPY api/src ./api/src
RUN ./gradlew api:bootJar
2022-04-21 17:53:00 +07:00
# Build for container image
2023-03-09 18:32:09 +07:00
FROM bellsoft/liberica-openjre-alpine-musl
2022-04-21 17:53:00 +07:00
LABEL maintainer="sombochea@cubetiqs.com"
# 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
2023-03-09 18:32:09 +07:00
COPY --from=builder /app/${API_BUILD_DIR}/libs/api.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"]