MinecraftServer / Dockerfile
YoBatM's picture
Update Dockerfile
70bcbd7 verified
raw
history blame
1.23 kB
#1.21.1
FROM openjdk:21-slim
#1.12.2
#FROM openjdk:8-jre-alpine
WORKDIR /app
#1.21.1
RUN apt-get update -y
RUN apt-get install wget -y
RUN apt-get install curl -y
RUN apt-get install jq -y
RUN wget -O server.jar https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/116/downloads/paper-1.21.1-116.jar
#1.12.2
#RUN wget -O server.jar https://api.papermc.io/v2/projects/paper/versions/1.12.2/builds/1620/downloads/paper-1.12.2-1620.jar
COPY --chown=1000 . /app
RUN chmod -R 777 /app
EXPOSE 7000
EXPOSE 7001
RUN bash save.sh /app/pruebas.txt /app/hola.txt
#RUN bash load.sh https://www.jsonblob.com/api/jsonBlob/1291001013413470208 archivo.txt
#Los de abajo puedes quitarlo si no usas esos plugins
RUN --mount=type=secret,id=bot_token,mode=0444,required=true sed -i "s/BOTTOKEN/$(cat /run/secrets/bot_token)/g" /app/plugins/DiscordSRV/config.yml
RUN --mount=type=secret,id=console_id,mode=0444,required=true sed -i "s/CONSOLEID/$(cat /run/secrets/console_id)/g" /app/plugins/DiscordSRV/config.yml
RUN --mount=type=secret,id=minekube_token,mode=0444,required=true sed -i "s/TOKENHERE/$(cat /run/secrets/minekube_token)/g" /app/plugins/connect/token.json
CMD java -Xmx2G -Xms2G -jar server.jar --noconsole --nojline
#CMD ls