Last active
February 2, 2021 20:14
-
-
Save KevM/3cd4509f34f88cf2007833faa2ddca14 to your computer and use it in GitHub Desktop.
Minecraft Docker Compose file for Azure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> docker compose up | |
> az container logs --resource-group my-resource-group --name minecraft --follow | |
> docker compose down |
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
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?