Backend/Dockerfile

34 lines
739 B
Docker

ARG GRADLE_VERSION=7.1
ARG JAVA_VERSION=11
FROM gradle:$GRADLE_VERSION-jdk$JAVA_VERSION AS build
WORKDIR /usr/src
COPY . .
ARG CRE_VERSION=dev
RUN gradle bootJar -Pversion=$CRE_VERSION
FROM alpine:latest
WORKDIR /usr/bin
ARG JAVA_VERSION
RUN apk add --no-cache openjdk$JAVA_VERSION
ARG CRE_VERSION
COPY --from=build /usr/src/build/libs/ColorRecipesExplorer-$CRE_VERSION.jar ColorRecipesExplorer.jar
ARG CRE_PORT=9090
EXPOSE $CRE_PORT
ENV spring_profiles_active=h2,rest
ENV server_port=$CRE_PORT
ENV spring_datasource_url=jdbc:h2:mem:cre
ENV spring_datasource_username=root
ENV spring_datasource_password=pass
VOLUME /usr/bin/data
VOLUME /usr/bin/config
VOLUME /usr/bin/logs
ENTRYPOINT ["java", "-jar", "ColorRecipesExplorer.jar"]