https://github.com/mjisaak/docker-dotnetcore-angular
Docker image to build dotnet core based Angular projects
https://github.com/mjisaak/docker-dotnetcore-angular
angular docker dotnetcore node npm
Last synced: 6 months ago
JSON representation
Docker image to build dotnet core based Angular projects
- Host: GitHub
- URL: https://github.com/mjisaak/docker-dotnetcore-angular
- Owner: mjisaak
- Created: 2019-03-05T08:24:26.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-04-23T14:53:09.000Z (almost 6 years ago)
- Last Synced: 2025-07-07T05:44:55.316Z (9 months ago)
- Topics: angular, docker, dotnetcore, node, npm
- Language: Dockerfile
- Size: 7.81 KB
- Stars: 8
- Watchers: 0
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Build container for dotnet Angular projects
[mjibrandl/dotnetcore-angular](https://hub.docker.com/r/mjibrandl/dotnetcore-angular) is a docker image to build dotnet core based Angular projects.
This image is based on *microsoft/dotnet:2.2-sdk* and contains everything you need to build a dotnet core based Angular project:
* Node.js 8.x LTS
* NPM (latest)
* node-sass (latest)
* Angular CLI (latest)
The image will reduce your build time to a minimum since you don't have to run ```npm rebuild node-sass``` for every build.
[](https://dev.azure.com/mjisaak/dockerhub-dotnetcore-angular/_build/latest?definitionId=4&branchName=master)
# Usage
Consider you created a project using ```dotnet new angular -o MyAngular```, all you need to containerize your project is the following Dockerfile:
```bash
FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mjibrandl/dotnetcore-angular:latest AS build
WORKDIR /src
COPY ["MyAngular.csproj", "./"]
RUN dotnet restore "./MyAngular.csproj"
COPY . .
WORKDIR "/src"
RUN dotnet build "MyAngular.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "MyAngular.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "MyAngular.dll"]
```