Skip to content

Instantly share code, notes, and snippets.

@diced
Created June 25, 2022 04:35
Show Gist options
  • Save diced/7dc3291253670ef13cbd2df94a846828 to your computer and use it in GitHub Desktop.
Save diced/7dc3291253670ef13cbd2df94a846828 to your computer and use it in GitHub Desktop.
minecraft server on docker
version: '3'
services:
minecraft:
container_name: mc
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
volumes:
- '.:/mc'
ports:
- 25565:25565
stdin_open: true
tty: true
FROM openjdk:18-slim-bullseye
WORKDIR /mc
CMD ["sh", "start.sh"]
java -Xms8G -Xmx8G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs/ -Daikars.new.flags=true -jar server.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment