Skip to content

Instantly share code, notes, and snippets.

@shawnweisfeld
Last active April 25, 2018 14:38
Show Gist options
  • Save shawnweisfeld/f3230b355e3907c9b3497b1a98e2e214 to your computer and use it in GitHub Desktop.
Save shawnweisfeld/f3230b355e3907c9b3497b1a98e2e214 to your computer and use it in GitHub Desktop.
# directories
**/bin/
**/obj/
**/out/
# files
Dockerfile*
**/*.trx
**/*.md

NOTE: put both in the folder above your .csproj file

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