mirror of https://github.com/doccano/doccano.git
Clemens Wolff
5 years ago
2 changed files with 206 additions and 0 deletions
Split View
Diff Options
-
9README.md
-
197azuredeploy.json
@ -0,0 +1,197 @@ |
|||
{ |
|||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", |
|||
"contentVersion": "1.0.0.0", |
|||
"parameters": { |
|||
"appName":{ |
|||
"type": "string", |
|||
"minLength": 1, |
|||
"metadata": { |
|||
"description": "The name for the webapp. Must be globally unique." |
|||
} |
|||
}, |
|||
"secretKey":{ |
|||
"type": "securestring", |
|||
"minLength": 16, |
|||
"metadata": { |
|||
"description": "The value to use as the Django secret key." |
|||
} |
|||
}, |
|||
"adminUserName":{ |
|||
"type": "string", |
|||
"minLength": 1, |
|||
"metadata": { |
|||
"description": "The user name for the Postgres administrator" |
|||
} |
|||
}, |
|||
"adminPassword":{ |
|||
"type": "securestring", |
|||
"minLength": 16, |
|||
"metadata": { |
|||
"description": "The password for the Postgres administrator" |
|||
} |
|||
}, |
|||
"appServiceSku": { |
|||
"type": "string", |
|||
"defaultValue": "B2", |
|||
"allowedValues": [ |
|||
"B1", |
|||
"B2", |
|||
"B3", |
|||
"S1", |
|||
"S2", |
|||
"S3" |
|||
], |
|||
"metadata": { |
|||
"description": "The SKU of the webapp hosting tier." |
|||
} |
|||
}, |
|||
"databaseCores": { |
|||
"type": "int", |
|||
"defaultValue": 2, |
|||
"allowedValues": [ |
|||
2, |
|||
4, |
|||
8, |
|||
16, |
|||
32, |
|||
64 |
|||
], |
|||
"metadata": { |
|||
"description": "The number of vCores to provision for the PostgreSQL server." |
|||
} |
|||
}, |
|||
"databaseSize": { |
|||
"type": "int", |
|||
"minValue": 51200, |
|||
"defaultValue": 51200, |
|||
"metadata": { |
|||
"description": "The storage capacity to provision for the PostgreSQL server." |
|||
} |
|||
}, |
|||
"databaseName": { |
|||
"type": "string", |
|||
"minLength": 1, |
|||
"defaultValue": "doccano", |
|||
"metadata": { |
|||
"description": "The name of the database to provision on the PostgreSQL server." |
|||
} |
|||
}, |
|||
"dockerImageName": { |
|||
"type": "string", |
|||
"minLength": 1, |
|||
"defaultValue": "cwolff/doccano:latest", |
|||
"metadata": { |
|||
"description": "The Docker image to deploy." |
|||
} |
|||
} |
|||
}, |
|||
"variables": { |
|||
"location": "[resourceGroup().location]", |
|||
"databaseSkuTier": "GeneralPurpose", |
|||
"databaseSkuFamily": "Gen5", |
|||
"databaseSkuName": "[concat('GP_', variables('databaseSkuFamily'), '_', parameters('databaseCores'))]", |
|||
"databaseConnectionString": "[concat('pgsql://', parameters('adminUserName'), '@', variables('databaseServerName'), ':', parameters('adminPassword'), '@', variables('databaseServerName'), '.postgres.database.azure.com:5432/', parameters('databaseName'))]", |
|||
"databaseVersion": "9.6", |
|||
"databaseServerName": "[concat(parameters('appName'),'-state')]", |
|||
"appServicePlanName": "[concat(parameters('appName'),'-hosting')]" |
|||
}, |
|||
"resources": [ |
|||
{ |
|||
"apiVersion": "2017-08-01", |
|||
"type": "Microsoft.Web/serverfarms", |
|||
"kind": "linux", |
|||
"name": "[variables('appServicePlanName')]", |
|||
"location": "[variables('location')]", |
|||
"properties": { |
|||
"reserved": true |
|||
}, |
|||
"dependsOn": [], |
|||
"sku": { |
|||
"name": "[parameters('appServiceSku')]" |
|||
} |
|||
}, |
|||
{ |
|||
"apiVersion": "2017-12-01", |
|||
"type": "Microsoft.DBforPostgreSQL/servers", |
|||
"location": "[variables('location')]", |
|||
"name": "[variables('databaseServerName')]", |
|||
"sku": { |
|||
"name": "[variables('databaseSkuName')]", |
|||
"tier": "[variables('databaseSkuTier')]", |
|||
"family": "[variables('databaseSkuFamily')]", |
|||
"capacity": "[parameters('databaseCores')]", |
|||
"size": "[parameters('databaseSize')]" |
|||
}, |
|||
"properties": { |
|||
"version": "[variables('databaseVersion')]", |
|||
"administratorLogin": "[parameters('adminUserName')]", |
|||
"administratorLoginPassword": "[parameters('adminPassword')]", |
|||
"storageMB": "[parameters('databaseSize')]" |
|||
}, |
|||
"resources": [ |
|||
{ |
|||
"name": "allowAzure", |
|||
"type": "firewallrules", |
|||
"apiVersion": "2017-12-01", |
|||
"location": "[variables('location')]", |
|||
"properties": { |
|||
"startIpAddress": "0.0.0.0", |
|||
"endIpAddress": "0.0.0.0" |
|||
}, |
|||
"dependsOn": [ |
|||
"[resourceId('Microsoft.DBforPostgreSQL/servers/', variables('databaseServerName'))]" |
|||
] |
|||
}, |
|||
{ |
|||
"name": "[parameters('databaseName')]", |
|||
"type": "databases", |
|||
"apiVersion": "2017-12-01", |
|||
"properties": { |
|||
"charset": "utf8", |
|||
"collation": "English_United States.1252" |
|||
}, |
|||
"dependsOn": [ |
|||
"[resourceId('Microsoft.DBforPostgreSQL/servers/', variables('databaseServerName'))]" |
|||
] |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
"type": "Microsoft.Web/sites", |
|||
"apiVersion": "2016-08-01", |
|||
"name": "[parameters('appName')]", |
|||
"kind": "app,linux,container", |
|||
"location": "[variables('location')]", |
|||
"dependsOn": [ |
|||
"[resourceId('Microsoft.DBforPostgreSQL/servers/', variables('databaseServerName'))]", |
|||
"[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]" |
|||
], |
|||
"properties": { |
|||
"name": "[parameters('appName')]", |
|||
"siteConfig": { |
|||
"linuxFxVersion": "[concat('DOCKER|', parameters('dockerImageName'))]", |
|||
"alwaysOn": true, |
|||
"appSettings": [ |
|||
{ |
|||
"name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE", |
|||
"value": "false" |
|||
}, |
|||
{ |
|||
"name": "DEBUG", |
|||
"value": "False" |
|||
}, |
|||
{ |
|||
"name": "SECRET_KEY", |
|||
"value": "[parameters('secretKey')]" |
|||
}, |
|||
{ |
|||
"name": "DATABASE_URL", |
|||
"value": "[variables('databaseConnectionString')]" |
|||
} |
|||
] |
|||
}, |
|||
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]" |
|||
} |
|||
} |
|||
] |
|||
} |
Write
Preview
Loading…
Cancel
Save