Skip to content

Instantly share code, notes, and snippets.

@foofoodog
Created January 5, 2019 19:28
Show Gist options
  • Save foofoodog/ebd95f6c9ff170391e0d4fbcfa461185 to your computer and use it in GitHub Desktop.
Save foofoodog/ebd95f6c9ff170391e0d4fbcfa461185 to your computer and use it in GitHub Desktop.
# REF https://www.talkingdotnet.com/how-to-create-an-angular-6-app-with-visual-studio-2017/
# REF https://docs.docker.com/engine/examples/dotnetcore/#build-and-run-the-docker-image
FROM microsoft/dotnet:sdk AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN apt-get update; \
apt-get install -y gnupg gnupg2 gnupg1; \
curl -sL https://deb.nodesource.com/setup_10.x | bash - ; \
apt-get install -y nodejs ; \
npm install @angular/cli -g ; \
dotnet restore
# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out
# Build runtime image
FROM microsoft/dotnet:aspnetcore-runtime
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "WebApplication1.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment