Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions StarshipWebApp/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# === Database ===
ConnectionStrings__DefaultConnection=Server=YOUR_SERVER;Database=StarshipDb;User Id=YOUR_USERNAME;Password=YOUR_PASSWORD;

# === Google OAuth ===
Authentication__Google__ClientId=your-google-client-id.apps.googleusercontent.com
Authentication__Google__ClientSecret=your-google-client-secret

6 changes: 6 additions & 0 deletions StarshipWebApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@

var builder = WebApplication.CreateBuilder(args);

builder.Configuration
.AddJsonFile("appsettings.json", optional: false)
.AddEnvironmentVariables();



// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_dependencyType": "compute.appService.container"
},
"parameters": {
"resourceGroupName": {
"type": "string",
"defaultValue": "DefaultResourceGroup-CUS",
"metadata": {
"description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
}
},
"resourceGroupLocation": {
"type": "string",
"defaultValue": "centralus",
"metadata": {
"description": "Location of the resource group. Resource groups could have different location than resources, however by default we use API versions from latest hybrid profile which support all locations for resource types we support."
}
},
"resourceName": {
"type": "string",
"defaultValue": "DevMandoStarships",
"metadata": {
"description": "Name of the main resource to be created by this template."
}
},
"resourceLocation": {
"type": "string",
"defaultValue": "[parameters('resourceGroupLocation')]",
"metadata": {
"description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
}
}
},
"variables": {
"appServicePlan_name": "[concat('Plan', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
"appServicePlan_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/serverFarms/', variables('appServicePlan_name'))]",
"appServiceContainer_name": "['Container', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]"
},
"resources": [
{
"type": "Microsoft.Resources/resourceGroups",
"name": "[parameters('resourceGroupName')]",
"location": "[parameters('resourceGroupLocation')]",
"apiVersion": "2019-10-01"
},
{
"type": "Microsoft.Resources/deployments",
"name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
"resourceGroup": "[parameters('resourceGroupName')]",
"apiVersion": "2019-10-01",
"dependsOn": [
"[parameters('resourceGroupName')]"
],
"properties": {
"mode": "Incremental",
"template": {
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"location": "[parameters('resourceLocation')]",
"name": "[parameters('resourceName')]",
"type": "Microsoft.Web/sites",
"apiVersion": "2015-08-01",
"tags": {
"[concat('hidden-related:', variables('appServicePlan_ResourceId'))]": "empty"
},
"dependsOn": [
"[variables('appServicePlan_ResourceId')]"
],
"kind": "app",
"properties": {
"name": "[parameters('resourceName')]",
"kind": "app",
"httpsOnly": true,
"reserved": false,
"serverFarmId": "[variables('appServicePlan_ResourceId')]",
"siteConfig": {
"linuxFxVersion": "DOCKER|nginx"
}
},
"identity": {
"type": "SystemAssigned"
}
},
{
"location": "[parameters('resourceLocation')]",
"name": "[variables('appServicePlan_name')]",
"type": "Microsoft.Web/serverFarms",
"apiVersion": "2015-02-01",
"kind": "linux",
"properties": {
"name": "[variables('appServicePlan_name')]",
"sku": "Standard",
"workerSizeId": "0",
"reserved": true
}
},
{
"location": "[parameters('resourceLocation')]",
"name": "[variables('appServiceContainer_name')]",
"type": "Microsoft.ContainerRegistry/registries",
"apiVersion": "2017-10-01",
"sku": {
"name": "Standard"
},
"properties": {
"tenantId": "[subscription().tenantId]",
"adminUserEnabled": false
}
}
]
}
}
}
]
}
11 changes: 11 additions & 0 deletions StarshipWebApp/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.9'

services:
web:
build: .
ports:
- "8080:80"
environment:
Authentication__Google__ClientId: ${GOOGLE_CLIENT_ID}
Authentication__Google__ClientSecret: ${GOOGLE_CLIENT_SECRET}
ConnectionStrings__DefaultConnection: ${CONNECTIONSTRINGS__DEFAULTCONNECTION}