Skip to content

Instantly share code, notes, and snippets.

@blehr
Created November 7, 2018 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blehr/5785730971a728b882deea5841c3f749 to your computer and use it in GitHub Desktop.
Save blehr/5785730971a728b882deea5841c3f749 to your computer and use it in GitHub Desktop.
dotnet core 2.1 dockerfile
FROM microsoft/dotnet:2.1-sdk AS build-env
WORKDIR /app
# Copy csproj and restore
COPY *.csproj ./
RUN dotnet restore
# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out
# Build runtime image
FROM microsoft/dotnet:2.1-aspnetcore-runtime
WORKDIR /.
COPY --from=build-env /app/out .
ENV ASPNETCORE_URLS http://+:5000
EXPOSE 5000
# Change name of dll for your application
ENTRYPOINT ["dotnet", "AlpacaTracker.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment