WebSPA is not running on debug mode in visual studio 2019
See original GitHub issueI noticed when hit F5 to debug eshoponcontainer the following events happen: 1- It builds an image with dev tag 2- WebSPA browsing is failed
After struggling, I Found the reason which is: 1- When a docker-compose build happen the following command is executed:
docker-compose -f "D:\SC\eShopOnContainers\src\docker-compose.yml" -f "D:\SC\eShopOnContainers\src\docker-compose.override.yml" -f "D:\SC\eShopOnContainers\src\docker-compose.vs.debug.yml" -p dockercompose2985742593939684029 --no-ansi config
As you can see docker-compose.vs.debug.yml will override the original and if you open this file in WebSPA part you can see: Targe:base, as well as this if you open cli on WebSPA container and execute node -v there is not proper result! So my suggestion was to install nodejs in base layer and This resolved the issue: ARG NODE_IMAGE=node:12.0 FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base WORKDIR /app COPY Web/WebSPA/Client/package.json . COPY Web/WebSPA/Client/package-lock.json . #I added this part RUN apt-get update RUN apt-get -y install curl gnupg RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - RUN apt-get -y install nodejs RUN npm install RUN npm -v EXPOSE 80
My question: Is this a bug in the source file?
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Thank you @PSepah for sharing the details again. It has been documented under WebSPA project doesn’t come up on debug mode in Visual Studio 2019
I am closing this issue as of now. Please feel free to reopen if needed.
Yes of course! In fact, I explained the steps in the first message which is: My suggestion is to install nodejs in the base layer and this resolved the issue: …\eShopOnContainers\src\Web\WebSPA\Dockerfile: - ARG NODE_IMAGE=node:12.0 - FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base - WORKDIR /app - COPY Web/WebSPA/Client/package.json . - COPY Web/WebSPA/Client/package-lock.json . - #I added this part - RUN apt-get update - RUN apt-get -y install curl gnupg - RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - - RUN apt-get -y install nodejs - RUN npm install - RUN npm -v - EXPOSE 80 As well as this change: webspa: environment: - ASPNETCORE_ENVIRONMENT=Implement to webspa: environment: - ASPNETCORE_ENVIRONMENT=Development In: docker-compose.override.yml