FROM openjdk:8-jre-alpine

WORKDIR /home/minecraft
ADD launch.sh /home/minecraft/launch.sh
ADD start-minecraft.sh /home/minecraft/start-minecraft.sh
ADD base.properties /home/minecraft/base.properties

RUN apk add --no-cache su-exec python python-dev py2-pip bash \
&& addgroup -g 1000 minecraft \
&& adduser -D -u 1000 -G minecraft -h /home/minecraft minecraft \
&& pip install mcstatus \
&& apk del python-dev \
&& rm -rf /var/cache/apk/* \
&& chown minecraft:minecraft /home/minecraft/*

CMD ["/home/minecraft/launch.sh"]

ENV UID=1000 GIU=1000 \
  MOTD="A Minecraft Server running under Docker" \
  LEVEL=world PVP=true \
  SERVER=server.jar \
  JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G"


