-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnodeapp-containerapp.bicep
87 lines (73 loc) · 1.85 KB
/
nodeapp-containerapp.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@description('Container apps environment name')
param environment_name string
@description('Custom message for the app')
param custom_message string = 'nodeapp'
@description('Container image name (registry/image:tag)')
param image_name string
@description('Private container registry login server')
param registry_login_server string
@description('Private container registry username')
param registry_username string
@description('Private container registry password')
param registry_password string
@description('Provide a location for the Container Apps resources')
param location string = resourceGroup().location
resource nodeapp 'Microsoft.App/containerApps@2022-01-01-preview' = {
name: 'nodeapp'
location: location
properties: {
managedEnvironmentId: resourceId('Microsoft.App/managedEnvironments', environment_name)
configuration: {
ingress: {
external: true
targetPort: 3000
}
activeRevisionsMode: 'multiple'
dapr: {
enabled: true
appId: 'nodeapp'
appProtocol: 'http'
appPort: 3000
}
secrets: [
{
name: 'registry-password'
value: registry_password
}
]
registries: [
{
server: registry_login_server
username: registry_username
passwordSecretRef: 'registry-password'
}
]
}
template: {
containers: [
{
image: image_name
name: 'nodeapp'
env: [
{
name: 'MESSAGE'
value: custom_message
}
{
name: 'PERSIST_ORDERS'
value: 'true'
}
]
resources: {
cpu: '0.5'
memory: '1Gi'
}
}
]
scale: {
minReplicas: 1
maxReplicas: 1
}
}
}
}