Skip to content

Instantly share code, notes, and snippets.

@kcoderhtml
Last active July 8, 2023 23:06
Show Gist options
  • Save kcoderhtml/dfc6674cf92c540bf0952d6387e7feab to your computer and use it in GitHub Desktop.
Save kcoderhtml/dfc6674cf92c540bf0952d6387e7feab to your computer and use it in GitHub Desktop.
Docker Compose itzg/minecraft-server
version: "3.7"
services:
mc:
container_name: mc
image: itzg/minecraft-server:latest
tty: true # equivalent for -t
stdin_open: true # equivalent for -i
# restart: unless-stopped
volumes:
# use a named, managed volume for data volume
- ./data:/data
# attach local host directory "mods" in same directory as this compose file
# all mods in this directory get copied into /data/mods at startup
# uncomment the following line if you are planning on adding mods
# - ~/mods:/mods:ro
env_file: .env
ports:
# expose the Minecraft server port outside of container
- 25565:25565
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment