FROM denoland/deno:debian

WORKDIR /mcgrizz
# USER deno

COPY . .

# RUN deno task build
RUN deno cache main.ts
# Install OpenJDK-17
RUN apt-get update && \
    apt-get install -y openjdk-17-jre ca-certificates-java && \
    apt-get clean && \
    update-ca-certificates -f
# Setup JAVA_HOME -- useful for docker commandline
ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64/
RUN export JAVA_HOME

EXPOSE 8000
EXPOSE 25565-25575

VOLUME [ "/mcgrizz" ]

CMD [ "run", "-A", "main.ts" ]