-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM mcr.microsoft.com/azure-functions/java:4-java11 | ||
|
||
COPY samples-azure-functions/build/azure-functions/azure-functions-sample/ /home/site/wwwroot/ | ||
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \ | ||
AzureFunctionsJobHost__Logging__Console__IsEnabled=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Installing PowerShell: https://docs.microsoft.com/powershell/scripting/install/installing-powershell | ||
|
||
param( | ||
[Parameter(Mandatory=$true)] | ||
[string]$DockerfilePath, | ||
[string]$ImageName="dfapp", | ||
[string]$ContainerName="app", | ||
[switch]$NoSetup=$false, | ||
[switch]$NoValidation=$false, | ||
[string]$AzuriteVersion="3.20.1", | ||
[int]$Sleep=30 | ||
) | ||
|
||
$ErrorActionPreference = "Stop" | ||
|
||
if ($NoSetup -eq $false) { | ||
# Build the docker image first, since that's the most critical step | ||
Write-Host "Building sample app Docker container from '$DockerfilePath'..." -ForegroundColor Yellow | ||
docker build -f $DockerfilePath -t $ImageName --progress plain . | ||
|
||
# Next, download and start the Azurite emulator Docker image | ||
Write-Host "Pulling down the mcr.microsoft.com/azure-storage/azurite:$AzuriteVersion image..." -ForegroundColor Yellow | ||
docker pull "mcr.microsoft.com/azure-storage/azurite:${AzuriteVersion}" | ||
|
||
Write-Host "Starting Azurite storage emulator using default ports..." -ForegroundColor Yellow | ||
docker run --name 'azurite' -p 10000:10000 -p 10001:10001 -p 10002:10002 -d "mcr.microsoft.com/azure-storage/azurite:${AzuriteVersion}" | ||
|
||
# Finally, start up the smoke test container, which will connect to the Azurite container | ||
docker run --name $ContainerName -p 8080:80 -it --add-host=host.docker.internal:host-gateway -d ` | ||
--env 'AzureWebJobsStorage=UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://host.docker.internal' ` | ||
--env 'WEBSITE_HOSTNAME=localhost:8080' ` | ||
$ImageName | ||
} | ||
|
||
if ($sleep -gt 0) { | ||
# The container needs a bit more time before it can start receiving requests | ||
Write-Host "Sleeping for $Sleep seconds to let the container finish initializing..." -ForegroundColor Yellow | ||
Start-Sleep -Seconds $Sleep | ||
} | ||
|
||
# Check to see what containers are running | ||
docker ps |