Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 331
Omtechguy Avatar asked Oct 16 '22 15:10

Omtechguy


1 Answers

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
like image 126
Edward Avatar answered Oct 19 '22 03:10

Edward