Skip to content

Instantly share code, notes, and snippets.

@KevM
Last active February 2, 2021 20:14
Show Gist options
  • 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
@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