FROM golang AS builder WORKDIR /app COPY ./src /app/src COPY ./go.mod /app COPY ./go.sum /app RUN go build -o /app/main /app/src/main.go RUN go build -o /app/cmd /app/src/cmd.go ARG JAVA_VERSION=16 FROM openjdk:16 ENV MIN_MEM=512M ENV MAX_MEM=1G ENV STOP="stop" ENV JAR=server.jar COPY --from=builder /app/main /main COPY --from=builder /app/cmd /usr/local/bin/cmd EXPOSE 25565 VOLUME [ "/server" ] WORKDIR /server ENTRYPOINT [ "/main" ]