Created
August 5, 2020 14:56
-
-
Save angelovstanton/65bece05ecaeff69277e257e5a71a759 to your computer and use it in GitHub Desktop.
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
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. | |
FROM mcr.microsoft.com/azure-functions/dotnet:3.0 AS base | |
WORKDIR /home/site/wwwroot | |
EXPOSE 80 | |
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build | |
WORKDIR /src | |
COPY ["WebDriverTestsAzureFunctions/WebDriverTestsAzureFunctions.csproj", "WebDriverTestsAzureFunctions/"] | |
RUN dotnet restore "WebDriverTestsAzureFunctions/WebDriverTestsAzureFunctions.csproj" | |
COPY . . | |
WORKDIR "/src/WebDriverTestsAzureFunctions" | |
RUN dotnet build "WebDriverTestsAzureFunctions.csproj" -c Release -o /app/build | |
FROM build AS publish | |
RUN dotnet publish "WebDriverTestsAzureFunctions.csproj" -c Release -o /app/publish | |
RUN apt-get update && \ | |
apt-get install -y gnupg wget curl unzip --no-install-recommends && \ | |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ | |
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list && \ | |
apt-get update -y && \ | |
apt-get install -y google-chrome-stable && \ | |
CHROMEVER=$(google-chrome --product-version | grep -o "[^\.]*\.[^\.]*\.[^\.]*") && \ | |
DRIVERVER=$(curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROMEVER") && \ | |
wget -q --continue -P /chromedriver "http://chromedriver.storage.googleapis.com/$DRIVERVER/chromedriver_linux64.zip" && \ | |
unzip /chromedriver/chromedriver* -d /usr/bin/ | |
FROM base AS final | |
WORKDIR /home/site/wwwroot | |
COPY --from=publish /app/publish . | |
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \ | |
AzureFunctionsJobHost__Logging__Console__IsEnabled=true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment