minecraftimage/Dockerfile

32 lines
465 B
Docker

ARG VERSION=17
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
FROM openjdk:$VERSION
ENV MIN_MEM=512M
ENV MAX_MEM=1G
ENV STOP="stop"
ENV JAR=server.jar
ENV REGEX=""
COPY --from=builder /app/main /main
COPY --from=builder /app/cmd /usr/local/bin/cmd
EXPOSE 25565
VOLUME [ "/server" ]
WORKDIR /server
ENTRYPOINT [ "/main" ]