Omtechguy
Omtechguy

Reputation: 3651

Angular Project not run on docker with visual studio 2019

I created a new web project on Visual Studio 2019 using the built in Angular template (ASP.NET Core 3).

enter image description here

Then, i Added a docker support using the wizard of visual studio (Right click on the project name -> Add -> Docker Support).

enter image description here

While the project working fine when i launching it from the visual studio using IIS Express, i am getting the following error when launching it using Docker:

enter image description here

enter image description here

I assume that something is missing in the docker file. This is the content of mine:

enter image description here

Upvotes: 5

Views: 1827

Answers (1)

Edward
Edward

Reputation: 29976

For this error, it is caused that node is not installed in mcr.microsoft.com/dotnet/core/aspnet:3.0-stretch-slim image, try to change your dockerfile to install node with version 10 or later.

FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-stretch-slim AS base
# BEGIN MODIFICATION - Node is needed for development (but not production)
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install --assume-yes nodejs
# END MODIFICATION

WORKDIR /app
EXPOSE 80
EXPOSE 443

Upvotes: 3

Related Questions