FROM public.ecr.aws/docker/library/eclipse-temurin:23.0.1_11-jdk AS builder
WORKDIR /app
COPY . /app
RUN ./gradlew shadowJar

FROM public.ecr.aws/docker/library/eclipse-temurin:23.0.1_11-jre AS runner
LABEL authors="skydust"
WORKDIR /app

RUN wget https://repo.zabbix.com/zabbix/7.2/release/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest_7.2+ubuntu24.04_all.deb
RUN dpkg -i zabbix-release_latest_7.2+ubuntu24.04_all.deb && rm zabbix-release_latest_7.2+ubuntu24.04_all.deb
RUN apt update && apt install -y zabbix-sender && rm -rf /var/lib/apt/lists/*

COPY --from=builder /app/build/libs/JdrBot.jar /app/JdrBot.jar
COPY start.sh /app

CMD ["/bin/bash","./start.sh"]
