I am trying to run the default angular template from .NET Core 3.1 as a docker instance.
I already read on different pages (also here) that adding the following should be enough.
RUN apt-get update && \
apt-get install -y wget && \
apt-get install -y gnupg2 && \
wget -qO- https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y build-essential nodejs
But I still get the following error:
/bin/sh: 2: /tmp/tmp859332ce906f4bcaad00b1b144b3fec4.exec.cmd: npm: not found
/src/Internationaal-Dashboard/Internationaal-Dashboard.csproj(42,5): error MSB3073: The command "npm install" exited with code 127.
The command '/bin/sh -c dotnet publish "Internationaal-Dashboard.csproj" -c Release -o /app/publish' returned a non-zero code: 1
Somebody any clue what I am forgetting.
I will include the full docker file below:
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
RUN apt-get update && \
apt-get install -y wget && \
apt-get install -y gnupg2 && \
wget -qO- https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y build-essential nodejs
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["Internationaal-Dashboard/Internationaal-Dashboard.csproj", "Internationaal-Dashboard/"]
RUN dotnet restore "Internationaal-Dashboard/Internationaal-Dashboard.csproj"
COPY . .
WORKDIR "/src/Internationaal-Dashboard"
RUN dotnet build "Internationaal-Dashboard.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Internationaal-Dashboard.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Internationaal-Dashboard.dll"]