Creating a webapp container for .net core API3.1 backend with node lts

Axesh Ajmera 1 Reputation point
2022-04-18T03:56:58.453+00:00

Hi all,

I already have an existing azure app service with .netcore 3.1 as backend for web-api's and nextjs based front end.

However I am planning to upgrade my frontend which requires node 16 or later. I believe create a custom docker image of .netcore3.1 with latest node

Any suggestion or existing docker image I can use directly for this scenario?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,136 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Andriy Bilous 11,011 Reputation points MVP
    2022-04-18T07:31:54.417+00:00

    Hello @Axesh Ajmera

    I suggest you to create your custom docker image based on .net core API3.1 and install node 16 as there is no official docker image that has both .net core 3.1 and node16 in it.
    I would not recommend to use 3rd party unofficial docker images as they may have security vulnerabilities.

    Dockerfile example with dotnet core sdk 3.1:

    FROM mcr.microsoft.com/dotnet/core/sdk:3.1  
      
    RUN apt-get update -yq \  
        && apt-get install curl gnupg -yq \  
        && curl -sL https://deb.nodesource.com/setup_16.x | bash \  
        && apt-get install nodejs -yq  
    

    Dockerfile example with dotnet core aspnet 3.1:

    FROM mcr.microsoft.com/dotnet/core/aspnet:3.1  
      
    RUN apt-get update -yq \  
        && apt-get install curl gnupg -yq \  
        && curl -sL https://deb.nodesource.com/setup_16.x | bash \  
        && apt-get install nodejs -yq  
    

    https://learn.microsoft.com/en-us/azure/app-service/tutorial-custom-container?pivots=container-linux

    0 comments No comments