#FROM maven:3.8.4-openjdk-17
FROM zenika/alpine-maven:3-jdk8

ARG MAVEN_PROFILE
ENV BUILD_PROFILE $MAVEN_PROFILE

COPY docker/filebeat.yml /etc/conf.d/
COPY docker/start.sh /app/

COPY . /app/

WORKDIR /app

#RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
#RUN apk update
#RUN apk add filebeat

RUN mvn clean
RUN mvn package -P $MAVEN_PROFILE -DskipTests=true

ENTRYPOINT ["/bin/sh", "-C", "start.sh"]
