# Создание рабочей среды для сборки
FROM maven:3.6.3-openjdk-17-slim as build
RUN mkdir -p /build/source
COPY . /build/source
WORKDIR /build/source
RUN mvn -am clean package
# Создание образа my-bar
FROM openjdk:17-jdk-slim as my-bar
COPY  --from=build /build/source/target/*.jar /data/app/my-bar.jar
WORKDIR /data/app
EXPOSE 8080
ENTRYPOINT "java" $JAVA_OPTS "-jar" "/data/app/my-bar.jar"