diff --git a/minecraft-server/README.md b/minecraft-server/README.md index b33459c4..1b4c683b 100644 --- a/minecraft-server/README.md +++ b/minecraft-server/README.md @@ -127,6 +127,37 @@ up: docker stop $ID docker start $ID +## Using Docker Compose + +Rather than type the server options below, the port mappings above, etc +every time you want to create new Minecraft server, you can now use +[Docker Compose](https://docs.docker.com/compose/). Start with a +`docker-compose.yml` file like the following: + +``` +minecraft-server: + ports: + - "25565:25565" + + environment: + EULA: TRUE + + image: itzg/minecraft-server + + container_name: minecraft-server + + tty: true + stdin_open: true + restart: always +``` + +and in the same directory as that file run + + docker-compose -d up + +Now, go play...or adjust the `environment` section to configure +this server instance. + ## Server configuration ### Difficulty diff --git a/minecraft-server/docker-compose.yml b/minecraft-server/docker-compose.yml new file mode 100644 index 00000000..e4e8f7c5 --- /dev/null +++ b/minecraft-server/docker-compose.yml @@ -0,0 +1,14 @@ +minecraft-server: + ports: + - "25565:25565" + + environment: + EULA: TRUE + + image: itzg/minecraft-server + + container_name: minecraft-server + + tty: true + stdin_open: true + restart: always