2022-01-24 20:59:56 +03:00
|
|
|
{
|
|
|
|
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
|
|
|
|
"contentVersion": "1.0.0.0",
|
|
|
|
"parameters": {
|
2022-02-09 00:28:16 +03:00
|
|
|
"appName": {
|
|
|
|
"defaultValue": null,
|
|
|
|
"type": "string",
|
|
|
|
"minLength": 5,
|
|
|
|
"maxLength": 63,
|
|
|
|
"metadata": {
|
|
|
|
"description": "A unique name for the app"
|
2022-01-24 20:59:56 +03:00
|
|
|
}
|
2022-02-09 00:28:16 +03:00
|
|
|
},
|
|
|
|
"containerImage": {
|
|
|
|
"type": "string",
|
|
|
|
"defaultValue": null,
|
|
|
|
"metadata": {
|
|
|
|
"description": "Container image to deploy"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"dockerRegistryUrl": {
|
|
|
|
"type": "String",
|
|
|
|
"metadata": {
|
|
|
|
"description": "Should be a valid host name without protocol"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"dockerRegistryUsername": {
|
|
|
|
"type": "String"
|
|
|
|
},
|
|
|
|
"dockerRegistryPassword": {
|
|
|
|
"type": "SecureString"
|
|
|
|
}
|
2022-01-24 20:59:56 +03:00
|
|
|
},
|
|
|
|
"resources": [
|
2022-02-09 00:28:16 +03:00
|
|
|
{
|
|
|
|
"type": "Microsoft.ContainerInstance/containerGroups",
|
|
|
|
"name": "[parameters('appName')]",
|
|
|
|
"apiVersion": "2021-07-01",
|
|
|
|
"location": "[resourceGroup().location]",
|
|
|
|
"properties": {
|
|
|
|
"containers": [
|
|
|
|
{
|
|
|
|
"name": "app",
|
|
|
|
"properties": {
|
|
|
|
"image": "[parameters('containerImage')]",
|
|
|
|
"ports": [
|
|
|
|
{
|
|
|
|
"protocol": "TCP",
|
|
|
|
"port": 4000
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"environmentVariables": [
|
|
|
|
{
|
|
|
|
"name": "PORT",
|
|
|
|
"value": "4000"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "NODE_ENV",
|
|
|
|
"value": "production"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "WEB_CONCURRENCY",
|
|
|
|
"value": "1"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "ENABLED_LANGUAGES",
|
|
|
|
"value": "en"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"resources": {
|
|
|
|
"requests": {
|
|
|
|
"memoryInGB": 4,
|
|
|
|
"cpu": 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"imageRegistryCredentials": [
|
|
|
|
{
|
|
|
|
"server": "[parameters('dockerRegistryUrl')]",
|
|
|
|
"username": "[parameters('dockerRegistryUsername')]",
|
|
|
|
"password": "[parameters('dockerRegistryPassword')]"
|
2022-01-24 20:59:56 +03:00
|
|
|
}
|
2022-02-09 00:28:16 +03:00
|
|
|
],
|
|
|
|
"restartPolicy": "Always",
|
|
|
|
"ipAddress": {
|
|
|
|
"ports": [
|
|
|
|
{
|
|
|
|
"protocol": "TCP",
|
|
|
|
"port": 4000
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"type": "Public",
|
|
|
|
"dnsNameLabel": "[parameters('appName')]"
|
|
|
|
},
|
|
|
|
"osType": "Linux"
|
2022-01-24 20:59:56 +03:00
|
|
|
}
|
2022-02-09 00:28:16 +03:00
|
|
|
}
|
2022-01-24 20:59:56 +03:00
|
|
|
],
|
|
|
|
"outputs": {
|
2022-02-09 00:28:16 +03:00
|
|
|
"defaultHostName": {
|
|
|
|
"value": "[reference(resourceId('Microsoft.ContainerInstance/containerGroups', parameters('appName'))).ipAddress.fqdn]",
|
|
|
|
"type": "string"
|
|
|
|
}
|
2022-01-24 20:59:56 +03:00
|
|
|
}
|
|
|
|
}
|