Instantly share code, notes, and snippets.

Embed
What would you like to do?
Minecraft Windows 1803 Container on Service Fabric Mesh
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string",
"defaultValue": "WestEurope",
"metadata": {
"description": "Location of the resources (e.g. westus, eastus, westeurope)."
}
}
},
"resources": [
{
"apiVersion": "2018-09-01-preview",
"name": "MinecraftNet",
"type": "Microsoft.ServiceFabricMesh/networks",
"location": "[parameters('location')]",
"dependsOn": [],
"properties": {
"kind": "Local",
"description": "Azure Service Fabric Mesh Minecraft Application network.",
"networkAddressPrefix": "10.0.0.0/24"
}
},
{
"apiVersion": "2018-09-01-preview",
"name": "MinecraftServerApp",
"type": "Microsoft.ServiceFabricMesh/applications",
"location": "[parameters('location')]",
"dependsOn": [
"Microsoft.ServiceFabricMesh/networks/MinecraftNet"
],
"properties": {
"description": "Service Fabric Mesh MineCraft Application!",
"services": [
{
"type": "Microsoft.ServiceFabricMesh/services",
"location": "[parameters('location')]",
"name": "MinecraftServerSvc",
"properties": {
"description": "Service Fabric Mesh Minecraft Service.",
"osType": "windows",
"codePackages": [
{
"name": "code",
"image": "openhack/minecraft-server:1.0-nanoserver-1803",
"volumes": [
{
"name": "sfvol",
"creationParameters": {
"kind": "ServiceFabricVolumeDisk",
"sizeDisk": "Small"
},
"destinationPath": "C:\\data"
}
],
"endpoints": [
{
"name": "minecraftListener",
"port": "25565"
},
{
"name": "minecraftAPIListener",
"port": "25575"
}
],
"environmentVariables": [
{
"name": "EULA",
"value": "TRUE"
}
],
"resources": {
"requests": {
"cpu": "2",
"memoryInGB": "2"
}
}
}
],
"replicaCount": "1",
"networkRefs": [
{
"name": "[resourceId('Microsoft.ServiceFabricMesh/networks', 'MinecraftNet')]",
"endpointRefs": [
{
"name": "minecraftListener"
},
{
"name": "minecraftAPIListener"
}
]
}
]
}
}
]
}
},
{
"apiVersion": "2018-09-01-preview",
"name": "MinecraftGateway",
"type": "Microsoft.ServiceFabricMesh/gateways",
"location": "[parameters('location')]",
"dependsOn": [
"Microsoft.ServiceFabricMesh/networks/MinecraftNet"
],
"properties": {
"description": "Service Fabric Mesh Gateway for Minecraft.",
"sourceNetwork": {
"name": "Open"
},
"destinationNetwork": {
"name": "[resourceId('Microsoft.ServiceFabricMesh/networks', 'MinecraftNet')]"
},
"tcp": [
{
"name": "Public",
"port": 25565,
"destination": {
"applicationName": "MinecraftServerApp",
"serviceName": "MinecraftServerSvc",
"endpointName": "minecraftListener"
}
},
{
"name": "Public",
"port": 25575,
"destination": {
"applicationName": "MinecraftServerApp",
"serviceName": "MinecraftServerSvc",
"endpointName": "minecraftAPIListener"
}
}
]
}
}
],
"outputs": {
"publicIPAddress": {
"value": "[reference('MinecraftGateway').ipAddress]",
"type": "string"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment