Created
December 27, 2018 10:38
-
-
Save PawelHaracz/d78b00979c1854b4f6458adbfa0870a4 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
FROM microsoft/dotnet:2.1-sdk AS build | |
WORKDIR /app | |
EXPOSE 80 | |
# 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 | |
WORKDIR /app | |
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