Skip to content

Instantly share code, notes, and snippets.

@KevM
Last active February 2, 2021 20:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KevM/3cd4509f34f88cf2007833faa2ddca14 to your computer and use it in GitHub Desktop.
Save KevM/3cd4509f34f88cf2007833faa2ddca14 to your computer and use it in GitHub Desktop.
Minecraft Docker Compose file for Azure
version: "3.7"
services:
mc:
image: itzg/minecraft-server
domainname: my-domain-name
ports:
- 25565:25565
environment:
EULA: "TRUE"
MEMORY: "1536M"
volumes:
# attach the relative directory 'data' to the container's /data path
- mcvolume:/data
deploy:
resources:
limits:
memory: 2G
volumes:
mcvolume:
driver: azure_file
driver_opts:
share_name: minecraft-docker-volume
storage_account_name: minecraftstorage
> docker compose up
> az container logs --resource-group my-resource-group --name minecraft --follow
> docker compose down
@hilelmshalom
Copy link

In line 6, what kind of domain can be used? it will be the one players will enter in order to join and play in the server?
I'm really intrigued about this: players joining a live mc server running in a docker deployed in azure. Does your file do the trick? what steps would I need to do to make it work?

@KevM
Copy link
Author

KevM commented Feb 2, 2021

You do get a fully qualified domain name (FQDN) but it is under an azure owned domain. Here is the naming convention:
{domainname}.{region}.azurecontainer.io

The domain name label is provided with the service (line 6). The region is controlled by the resource group under which your docker ACI context is setup.

To get your container mapped to your custom domain you can setup a CNAME record pointing at The Azure FQDN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment