Skip to content

Commit fbd08dc

Browse files
Merge pull request #1276 from redanthrax/docker
Docker support
2 parents 8204c18 + a79ecd4 commit fbd08dc

File tree

5 files changed

+87
-0
lines changed

5 files changed

+87
-0
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
local.settings.json

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ Cache_*
88
Logs
99
ExcludedTenants
1010
SendNotifications/config.json
11+
.env

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# To enable ssh & remote debugging on app service change the base image to the one below
2+
# FROM mcr.microsoft.com/azure-functions/powershell:4-powershell7.2-appservice
3+
FROM mcr.microsoft.com/azure-functions/powershell:4-powershell7.2
4+
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
5+
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
6+
7+
COPY . /home/site/wwwroot

docker-compose.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
services:
2+
azurite:
3+
image: mcr.microsoft.com/azure-storage/azurite
4+
container_name: azurite
5+
ports:
6+
- "10000:10000"
7+
- "10001:10001"
8+
- "10002:10002"
9+
networks:
10+
- func-network
11+
environment:
12+
- AZURITE_ACCOUNTS=devstoreaccount1:Eby8vdM02xNoBnZf6KgBVU4=
13+
14+
cippapi:
15+
build:
16+
context: .
17+
dockerfile: Dockerfile
18+
environment:
19+
- FUNCTIONS_WORKER_RUNTIME=${FUNCTIONS_WORKER_RUNTIME}
20+
- FUNCTIONS_WORKER_RUNTIME_VERSION=${FUNCTIONS_WORKER_RUNTIME_VERSION}
21+
- AzureWebJobsStorage=${AzureWebJobsStorage}
22+
- ApplicationID=${ApplicationID}
23+
- ApplicationSecret=${ApplicationSecret}
24+
- RefreshToken=${RefreshToken}
25+
- TenantID=${TenantID}
26+
- DEV_SKIP_BPA_TIMER=${DEV_SKIP_BPA_TIMER}
27+
- DEV_SKIP_DOMAIN_TIMER=${DEV_SKIP_DOMAIN_TIMER}
28+
- SetFromProfile=${SetFromProfile}
29+
- FUNCTIONS_EXTENSION_VERSION=${FUNCTIONS_EXTENSION_VERSION}
30+
- AzureWebJobs.BestPracticeAnalyser_OrchestrationStarterTimer.Disabled=true
31+
- AzureWebJobs.Domain_OrchestrationStarterTimer.Disabled=true
32+
- WEBSITE_HOSTNAME=cippapi
33+
depends_on:
34+
- azurite
35+
networks:
36+
- func-network
37+
deploy:
38+
replicas: 3
39+
40+
nginx:
41+
image: nginx:alpine
42+
container_name: nginx
43+
ports:
44+
- "7071:80"
45+
volumes:
46+
- ./nginx.conf:/etc/nginx/nginx.conf:ro
47+
depends_on:
48+
- cippapi
49+
networks:
50+
- func-network
51+
healthcheck:
52+
test: ["CMD", "curl", "-f", "http://cippapi:7071"]
53+
interval: 30s
54+
retries: 5
55+
56+
networks:
57+
func-network:
58+
driver: bridge

nginx.conf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
events {}
2+
3+
http {
4+
upstream functionapp_backend {
5+
server cippapi:80;
6+
}
7+
8+
server {
9+
listen 80;
10+
11+
location / {
12+
proxy_pass http://functionapp_backend;
13+
proxy_http_version 1.1;
14+
proxy_set_header Upgrade $http_upgrade;
15+
proxy_set_header Connection keep-alive;
16+
proxy_set_header Host $host;
17+
proxy_cache_bypass $http_upgrade;
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)