Created
November 7, 2018 14:44
-
-
Save blehr/5785730971a728b882deea5841c3f749 to your computer and use it in GitHub Desktop.
dotnet core 2.1 dockerfile
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-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