1
votes

Azure App Service : Multi container app

I have the use azure app service to deploy my spring application.

Three containers required as part of my requirement ( 2 for app and 1 for DB). App Images are having deployable artifacts (war) and two having different context path (accessing from web url /* and /test) with same port (8080).

samplecompose.yml

version: '3'
services:
  Web1:
    image: dockerhub.com/.../AppSample_Web1
    restart: always
    ports:
      - 9080:**9080**
  
  web2:
    image: dockerhub.com/.../AppSample_Web2
    restart: always
    ports:
      - 9081:**9080**
  DB:
   image: dockerhub.com/.../OracleDB..:latest

I tried the above process but am unable to access application pages. How to handle the ports in this case my two containers with same ports .

1
You can learn about virtual application and directories.Jason Pan
@JasonPan but the link you shared is for windows machines and what about linux machines? There is no virtual path settings under path mapping.Prateek Naik
@BenBean Linux machines doesn’t support virtual application. stackoverflow.com/questions/62810572/…Jason Pan

1 Answers

0
votes

As Jason said, Linux machines do not support virtual application.

Configuration of virtual directories on Linux App Service isn't done the same way as it is on Windows App Service.

The Virtual Directory configuration for Windows App Service maps directly to IIS' virtual directories feature, as all websites on that platform are hosted by IIS. On Linux App Service, you are free to use whatever web server technology you like and configure it however you want.

For now, the easiest way to implement this is to containerize your application with the settings you want, or fork one of our existing built-in containers.

You can add custom storage for your containerized app. Containerized apps include all Linux apps and also the Windows and Linux custom containers running on App Service.

For more details, you could refer to this article.