ARG java_version=21
FROM openjdk:${java_version}-jdk-slim-buster

ARG jar_name=train-1.0-SNAPSHOT-shaded.jar
ARG work_dir=model

# copy the packaged jar file into our docker image
COPY target/${jar_name} /${work_dir}/

RUN apt-get --assume-yes update; apt-get --assume-yes install nano; apt-get --assume-yes install systemd;
RUN apt-get --assume-yes update;
RUN echo "Europe/Vienna" > /etc/timezone
RUN ln -fs /usr/share/zoneinfo/`cat /etc/timezone` /etc/localtime
RUN dpkg-reconfigure -f noninteractive tzdata

# set the startup command to execute the jar
WORKDIR /${work_dir}