Skip to content
Open
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ $ docker run --name rbaskets -d -p 55555:55555 request-baskets
$ docker logs rbaskets
```

### Run container in Azure

See [bicep folder](./bicep) to deploy the container inside an Azure App Service with [Bicep](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/overview?tabs=bicep). This folder structure also supports [Azure Deployment Environments](https://learn.microsoft.com/en-us/azure/deployment-environments/overview-what-is-azure-deployment-environments).

### Cleanup

Stop and delete docker container:
Expand Down
17 changes: 17 additions & 0 deletions bicep/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# yaml-language-server: $schema=https://github.com/Azure/deployment-environments/releases/download/2022-11-11-preview/manifest.schema.json
name: BasketApp
summary: Deploy the Request Basket container app.
description: Deploys a Container App within an App Service.
templatePath: main.bicep
runner: Bicep
parameters:
- id: "projectName"
name: "Project Name"
description: "The basket project name"
type: "string"
default: "hellobasket"
- id: "basketAdminToken"
name: "Basket Admin Token"
description: "The Basket Admin Token"
type: "string"
default: "yolo"
69 changes: 69 additions & 0 deletions bicep/main.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*

az login
az deployment group create --resource-group ... --template-file main.bicep --parameters basketAdminPassword=yolo

*/

param location string = 'westeurope'
param projectName string = 'helloAzure'
param basketAdminToken string

resource appServicePlan 'Microsoft.Web/serverfarms@2023-12-01' = {
name: 'plan-baskets-${projectName}-001'
location: location
kind: 'linux'
properties: {
reserved: true
}
sku: {
name: 'F1'
tier: 'Free'
}
}

resource webApp 'Microsoft.Web/sites@2023-12-01' = {
name: 'app-baskets-${projectName}-001'
location: location
properties: {
serverFarmId: appServicePlan.id
siteConfig: {
linuxFxVersion: 'DOCKER|index.docker.io/darklynx/request-baskets'
appSettings: [
{
name: 'DOCKER_REGISTRY_SERVER_PASSWORD'
value: 'xxxxx'
}
{
name: 'DOCKER_REGISTRY_SERVER_URL'
value: 'https://index.docker.io'
}
//following settings are for the container itself, please see: https://github.com/darklynx/request-baskets?tab=readme-ov-file#parameters
{
name: 'MAXSIZE' //maximum allowed basket capacity, basket capacity greater than this number will be rejected by service
value: '77777'
}
{
name: 'TOKEN' // master token to gain control over all baskets, if not defined a random token will be generated when service is launched and printed to stdout
value: basketAdminToken
}
{
name: 'BASKET' //name of a basket to auto-create during service startup, this parameter can be specified multiple times
value: 'helloBasket'
}
{
name: 'MODE' //defines service operation mode: public - when any visitor can create a new basket, or restricted - baskets creation requires master token
value: 'public'
}
{
name: 'THEME' //CSS theme for web UI, supported values: standard, adaptive, flatly
value: 'flatly'
}
{
name: 'PAGE' //default page size when retrieving collections
value: '77777'
}
]
}
}
}