Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
FROM microsoft/dotnet:2.1-sdk AS build
# copy csproj and restore as distinct layers
COPY src/nuget.config ./src/
COPY src/*.sln ./src/
COPY src/Qbank.Questions/*.csproj ./src/Qbank.Questions/
COPY src/Qbank.Questions.WebApi/*.csproj ./src/Qbank.Questions.WebApi/
COPY test/Qbank.Questions.Test/*.csproj ./test/Qbank.Questions.Test/
RUN dotnet restore ./src/ --configfile ./src/nuget.config
# copy everything else and build app
COPY src/Qbank.Questions/. ./src/Qbank.Questions/
COPY src/Qbank.Questions.WebApi/. ./src/Qbank.Questions.WebApi/
COPY test/Qbank.Questions.Test/. ./test/Qbank.Questions.Test/
ENV VaultUrl=Default-keyVault
ENV ClientId=DefaultClientId
ENV ClientSecret=DefaultSecret
WORKDIR /app/src/Qbank.Questions.WebApi/
RUN dotnet publish -c Release -o out
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
COPY --from=build /app/src/Qbank.Questions.WebApi/out ./
ENTRYPOINT ["dotnet", "Qbank.Questions.WebApi.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.