NOTE: put both in the folder above your .csproj file
Last active
April 25, 2018 14:38
-
-
Save shawnweisfeld/f3230b355e3907c9b3497b1a98e2e214 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
# directories | |
**/bin/ | |
**/obj/ | |
**/out/ | |
# files | |
Dockerfile* | |
**/*.trx | |
**/*.md |
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.0-sdk AS build | |
WORKDIR /app | |
# copy csproj and restore as distinct layers | |
COPY MovieDB/*.csproj ./ | |
RUN dotnet restore | |
# copy everything else and build app | |
COPY MovieDB/. ./ | |
RUN dotnet publish -o out /p:PublishWithAspNetCoreTargetManifest="false" | |
FROM microsoft/dotnet:2.0-runtime AS runtime | |
ENV ASPNETCORE_URLS http://+:80 | |
WORKDIR /app | |
COPY --from=build /app/out ./ | |
ENTRYPOINT ["dotnet", "MovieDB.dll"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment