Skip to content

Instantly share code, notes, and snippets.

@SaurabhLpRocks
Created September 21, 2019 10:07
Show Gist options
  • Save SaurabhLpRocks/0c1b706993eab8008a8e07464cf8c681 to your computer and use it in GitHub Desktop.
Save SaurabhLpRocks/0c1b706993eab8008a8e07464cf8c681 to your computer and use it in GitHub Desktop.
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS base
WORKDIR /src
# Copy only the project file.
# We copied only the project file and not the complete source code
# to leaverage the docker's caching capabilities thereby optimizing up the build time.
COPY ["CoreApi.csproj", "./"]
# Restore the packages
RUN dotnet restore "./CoreApi.csproj"
# Copy the source code to the /src directory
COPY . .
# Expose ports 5000 & 5001 as our app will run on these ports
EXPOSE 5000 5001
ENTRYPOINT ["dotnet", "watch", "--project=CoreApi.csproj", "run"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment