'Which azure services to use ( AKS or App service) to deploy multiple docker containers (compose enabled) on azure

I am trying to deploy multiple web-app containers on azure cloud to implement CI/CD pipeline deployment for production environment. Currently I have built multiple container images using docker compose file which works totally fine on localhost environment. I tried to deploy the docker images to azure container registry and run them using azure web app services but it failed giving error "Cannot map container ports on ACI" . Looks like ACI doesn't support port mapping!

Can anyone suggest me a concrete solution to implement CI/CD deployment for multiple container deployment?

Technology stack of app: Nodejs and Angular

Docker: Docker desktop for windows (using Linux containers to build the images)

Cloud: Azure

I don't have much experience in the Devops world, it would be helpful if anyone can guide me at proper path to implement a CI/CD process for multi-container web application.

Thanks for your time!

Docker compose file:

version: "3.4"
services:
  frontend:
    build: ./frontend
    ports:
    - "85:80"
    expose:
    - "85"
    - "80"
    networks:
    - dev_network
    depends_on:
    - backend
  backend:
    build: ./backend
    ports:
    - "3000:8600"
    expose:
    - "3000"
    - "8600"
    networks:
    - dev_network
    
networks:
  dev_network:
    driver: bridge

Frontend Docker file:

# Stage 1: Compile and Build angular codebase

# Use official node image as the base image
FROM node:latest as build

# Set the working directory
WORKDIR /usr/local/app

# Add the source code to app
COPY ./ /usr/local/app/

# Install all the dependencies
RUN npm install

# Stage 2: Serve app with nginx server

FROM nginx:latest

COPY --from=build /usr/local/app/dist/ClientServicePortal /usr/share/nginx/html

# Expose port 80
EXPOSE 80

Backend Docker file:

FROM node:14-alpine
ENV NODE_ENV=production
WORKDIR /usr/src/app
COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"]
RUN npm install --production --silent && mv node_modules ../
COPY . .
EXPOSE 3000 8600
CMD ["node", "server.js"]


Solution 1:[1]

I'm not an expert but I think it depends on what kind of of infra/traffic you need for you application.

AKS allow you to set up scalling, load balancing, traffic control inside the cluster. Another advantage, if you are using Azure DevOps tool, is that AKS as a new feature in preview "Deployment center (preview)". This feature will create CI and CD based on a repository. It's a good help to start and see it working, after that you can jump in the config/settings and play with it :)

edit : your docker compose will be replaced by an K8s manifest, but it's "easy" to setup

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Thibault Pilette