Docker Compose Explained with 3 Microservices (Angular, Spring Boot & PostgreSQL DB) [ DevOps ]

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ม.ค. 2025

ความคิดเห็น • 82

  • @Techtter
    @Techtter  4 ปีที่แล้ว

    🦠VIDEO INDEX🦠
    1:49 - What is Docker?
    3:09 - Why we need Docker Compose?
    5:27 - Sample docker-compose.yaml file walk-through
    12:27 - Deploying Microservices(Angular, Spring Boot, PostgreSQL) using Docker Compose.
    I would love to see your comments about the demo. If you have any question or if you think there is something is missing, please let us know your feedback. Surely I will get back to you ASAP...Cheers..!!
    - Subscribe to Channel
    - Like & Share with friends

  • @mugilanit
    @mugilanit 4 ปีที่แล้ว +2

    Perfect example with demo in a 20 minutes video.The way you explained about docker compose and why we need to shift to Kubernetes is awesome. Appreciate your effort .

    • @Techtter
      @Techtter  4 ปีที่แล้ว +1

      Hi Mugilan..thanks ...I am glad that you liked it. I also made a video on Docker Volumes. Please like and subscribe to my channel. More videos on queue on DevOps stuff..cheers..

  • @rpidugu-hp6wm
    @rpidugu-hp6wm ปีที่แล้ว +1

    The best video on TH-cam about Docker Compose ❤

    • @Techtter
      @Techtter  ปีที่แล้ว

      Glad you think so!

  • @Techtter
    @Techtter  4 ปีที่แล้ว

    📌 Docker related Videos:
    ► Docker Compose Explained with Spring Boot: th-cam.com/video/ZZ2Llh4NhaY/w-d-xo.html
    ► Docker Volumes Explained with Postgresql: th-cam.com/video/QhjJPrnYIao/w-d-xo.html
    📌 Videos related to Kubernetes:
    ► What is Terraform: th-cam.com/video/9wRaFwKEUKI/w-d-xo.html
    ► Provisioning EKS cluster on AWS using Terraform: th-cam.com/video/rv6MOvpXU90/w-d-xo.html
    ► Kubernetes(EKS) Cluster Autoscaling & Horizontal Pod Autoscaling on AWS: th-cam.com/video/P1bfQy94aBk/w-d-xo.html
    ► Jenkins installation on Kubernetes / AWS using Terraform: th-cam.com/video/_uLeTb7eKR4/w-d-xo.html
    ► Octant - Kubernetes Dashboard UI: th-cam.com/video/S_-uOD3DNiM/w-d-xo.html
    ► KinD - Kubernetes in Docker for K8s cluster on laptop: th-cam.com/video/RTkoQiJ1x8w/w-d-xo.html
    ► Kubernetes Basics Explained: th-cam.com/video/KIV191levY4/w-d-xo.html
    ► Kuberenetes Cheat Sheet: th-cam.com/video/ik3iyhUmdO0/w-d-xo.html

  • @abhisekhdas8004
    @abhisekhdas8004 4 ปีที่แล้ว +2

    Nicely explained! to the point! Thanks a lot :)

    • @Techtter
      @Techtter  4 ปีที่แล้ว

      I am glad you liked it..subscribe to channel to get regular updates..

  • @markoziza7537
    @markoziza7537 3 ปีที่แล้ว +1

    Great tutorial, works great. Thanks

    • @Techtter
      @Techtter  3 ปีที่แล้ว

      Thanks Makro

    • @Techtter
      @Techtter  3 ปีที่แล้ว

      Hi Marko... I posted a new video on AWS Lambda. Watch it and like the video. I am planning to more videos on AWS Services. Let me know your opinion on it.

  • @FoxChpoks
    @FoxChpoks 3 ปีที่แล้ว +1

    Thank you for the lesson! Could you say please what plugin or some configuration do you use for termial? For example, the way how docker command is suggested at 12:57 isn't a default termials' feature

    • @Techtter
      @Techtter  3 ปีที่แล้ว +1

      Hi Britkov, just follow this video: th-cam.com/video/PUWnCbr9cN8/w-d-xo.html

    • @FoxChpoks
      @FoxChpoks 3 ปีที่แล้ว

      @@Techtter THANK YOU!

  • @benjamenaremu2027
    @benjamenaremu2027 4 ปีที่แล้ว +1

    Nicely explained. I really enjoyed the tutorial.

    • @Techtter
      @Techtter  4 ปีที่แล้ว

      Hi Benjamen... I am happy that you liked it.. stay tuned n subscribe to channel. Share with your colleagues n friends..

  • @mirkobalmaceda
    @mirkobalmaceda 4 ปีที่แล้ว +1

    Awesome tutorial, thanks you so much for sharing!

    • @Techtter
      @Techtter  4 ปีที่แล้ว +1

      Hi Mirco... Thanks for your compliment. I am glad that the video is useful for you. We are going to make more videos that are useful for many guys like you. Share the channel with your friends n colleagues. Cheers..!!

    • @Techtter
      @Techtter  3 ปีที่แล้ว

      Hi Mirko... I posted a new video on AWS Lambda. Watch it and like the video. I am planning to more videos on AWS Services. Let me know your opinion on it.

  • @MamaShareStories
    @MamaShareStories 4 ปีที่แล้ว

    Awesome was waiting for this!

    • @Techtter
      @Techtter  4 ปีที่แล้ว

      Thanks..

  • @murtazamohammadi9370
    @murtazamohammadi9370 3 ปีที่แล้ว +1

    can you make video, how to connect an angular app with sprint+postgress databse ?

    • @Techtter
      @Techtter  3 ปีที่แล้ว +1

      Hi ... This is the video with angular, spring boot n postgres

    • @murtazamohammadi9370
      @murtazamohammadi9370 3 ปีที่แล้ว +2

      @@Techtter can you make a new video from the scratch with the explanation please?

  • @RafaelNascimento-qo1jp
    @RafaelNascimento-qo1jp 4 ปีที่แล้ว +1

    Nice tutorial! How can map query string params with nginx? I have some endpoints at the backend that receive query string params, how can I make nginx make those requests?

    • @Techtter
      @Techtter  4 ปีที่แล้ว +1

      Thanks for the compliments..
      for example you can pass query string like below prepending the arg with "$" to the service url
      location ~ ^/service/ {
      proxy_pass /$uri$is_args$args;
      }

  • @djoleezcool
    @djoleezcool 3 ปีที่แล้ว +1

    Okay wait. With what did you map those values ?
    jdbc:postgresql://${DB_SERVER}/${POSTGRES_DB}
    When I try to build my project I getting error:
    org.postgresql.util.PSQLException: The connection attempt failed.
    How we can build Spring Boot project in .jar file with this non valid JDBC url ?
    Only way when is working is localhost which has no sense ...

    • @djoleezcool
      @djoleezcool 3 ปีที่แล้ว +1

      Second issue is: database with name "name" does not exists!
      So even I have hibernate property for creating database when app starts (ddl-auto: create) , that doesn't work.

    • @Techtter
      @Techtter  3 ปีที่แล้ว +1

      Hi Djordie, please follow the steps as explained in the video, there won't be any errors. All the best.

  • @amanshrivastava3671
    @amanshrivastava3671 4 ปีที่แล้ว +1

    I was working on a MEAN application with docker-compose. The full MEAN application is working on my development environment.
    I have an EC2 linux instance with docker-compose.
    With docker-compose, I am able to connect Node-Express-MongoDB. But when Angular is also included, though docker-compose is working but Angular Frontend is not able to call the Backend API's.
    Do you have any idea?

    • @Techtter
      @Techtter  4 ปีที่แล้ว

      Hi..Aman..when you are making calls from UI like Angular app, you need proxy to communicate with back-end service like Node app. You need to install NGINX proxy along side your Angular UI. You can do this in Dockerfile of your Angular UI.
      I have a similar project, look at complete code at my Github source: github.com/techtter/scrum-board
      - Look at #STAGE-2 in below code#Dockerfile of Angular UI
      - And also you need default.conf file in your base directory of Angular UI. see the content below
      - And also you need to link the back-end Node App name in docker-compose.yaml file.
      ------------Your front-end Angular UI Dockerfiel looks like this:
      ### STAGE 1: Build ###
      FROM node:12.7-alpine AS build
      WORKDIR /usr/src/app
      COPY package.json ./
      RUN npm install
      COPY . .
      RUN npm run build
      ### STAGE 2: Run ###
      FROM nginx:1.17.1-alpine
      COPY default.conf /etc/nginx/conf.d/default.conf
      COPY --from=build /usr/src/app/dist/scrum-ui /usr/share/nginx/html
      EXPOSE 80
      ----------And docker-compose.yaml file your front-end UI service look like below:
      #Fron-end Angular Application
      scrum-ui:
      build: ./scrum-ui
      container_name: scrum-ui
      ports:
      - 4200:80
      links:
      - scrum-app ## This is back-end service name, in my case it is "scrum-app"
      ------defualt.conf file-----------
      server {
      listen 80;
      server_name scrum-ui;
      root /usr/share/nginx/html;
      index index.html index.html;
      location /api/scrums {
      proxy_pass scrum-app:8080/api/scrums;
      }
      location /api/tasks {
      proxy_pass scrum-app:8080/api/tasks;
      }
      location / {
      try_files $uri $uri/ /index.html;
      }
      }

    • @Techtter
      @Techtter  4 ปีที่แล้ว

      Most importantly look at how you should pass back-end service details in nginx default.conf file

    • @amanshrivastava3671
      @amanshrivastava3671 4 ปีที่แล้ว +1

      @@Techtter Thanks for the reply. I will try this.

  • @satishmarutham3195
    @satishmarutham3195 4 ปีที่แล้ว +1

    Can U Plse Make an Video How To Deploy Angular Sprjng boot into Kubernates..

    • @Techtter
      @Techtter  4 ปีที่แล้ว +1

      Hi Satish... I already made a video on Spring Boot & MySQL deployment on Kubernetes. Check the link: th-cam.com/video/ThAkKPAwdpQ/w-d-xo.html. There is a GitHub repo from some guy for angular & spring boot: github.com/achalise/multi-tier-kubernetes

    • @satishmarutham3195
      @satishmarutham3195 4 ปีที่แล้ว +1

      @@Techtter Thank u So Much

    • @Techtter
      @Techtter  4 ปีที่แล้ว

      Welcome...!! Subscribe to channel n spread it with your friends if you like it..

  • @Pyrusmalus
    @Pyrusmalus 3 ปีที่แล้ว +1

    I have deploy the app using docker compose and able to access scrum ui but while creating scrum nothing is reflecting. Any idea on this please.?

    • @Techtter
      @Techtter  3 ปีที่แล้ว +1

      Make sure that database is up and running. Follow the steps explained in the video. It should work.

    • @Pyrusmalus
      @Pyrusmalus 3 ปีที่แล้ว

      Yes database is up, I can also put the data from swagger post API’s for scrum then I can able to see that in UI but unable to create new scrum from UI

    • @Pyrusmalus
      @Pyrusmalus 3 ปีที่แล้ว

      Can you please help me.? Waiting for your response 😊

  • @kapilkaushal6178
    @kapilkaushal6178 3 ปีที่แล้ว +1

    How these 3 containers are communicating with each other. Please advise.

    • @Techtter
      @Techtter  3 ปีที่แล้ว +1

      Hi..Kapil... If you look at the docker-compose.yml file, there is an attribute networks for each service and also at service level hierarchy. This makes each service know each other through network layer.
      Hope it clarifies your question.

    • @kapilkaushal6178
      @kapilkaushal6178 3 ปีที่แล้ว +1

      @@Techtter Thankyou for the reply. However I could see the port's section in the yaml file but not any network section...

    • @Techtter
      @Techtter  3 ปีที่แล้ว +1

      In this example I have not used networks attribute. By default there will network bridge assigned to the containers.

    • @kapilkaushal6178
      @kapilkaushal6178 3 ปีที่แล้ว +1

      @@Techtter Ok thankyou

  • @sidesarr9204
    @sidesarr9204 4 ปีที่แล้ว +1

    Hello
    I have the error "org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections." please can you help me ??

    • @Techtter
      @Techtter  4 ปีที่แล้ว +1

      Hi... Please check is there any other process is running on same port number?

  • @kishoremaroju2720
    @kishoremaroju2720 4 ปีที่แล้ว +1

    Awesome tutorial.
    Could Please consider doing videos on AWS local stack ?
    Spring boot + spring data jpa + dynamo db + s3 , thanks.

    • @Techtter
      @Techtter  4 ปีที่แล้ว +1

      Hey... Kishore... I will try to make a one on this. But before, I will look at on TH-cam, if there is best one already n will let you know. If I don't find any good one, surely I will make one.

  • @diego.camina
    @diego.camina 4 ปีที่แล้ว +1

    Thanks! :)

    • @Techtter
      @Techtter  4 ปีที่แล้ว

      Welcome.. Subscribe to channel and spread it with your colleagues and friends

    • @Techtter
      @Techtter  3 ปีที่แล้ว

      Hi Diego... I posted a new video on AWS Lambda. Watch it and like the video. I am planning to more videos on AWS Services. Let me know your opinion on it.

  • @hajarelalami5057
    @hajarelalami5057 2 ปีที่แล้ว +1

    what does each container do

    • @Techtter
      @Techtter  2 ปีที่แล้ว

      Please watch the video completed and you will know 😀

  • @theprogammerguy2023
    @theprogammerguy2023 2 ปีที่แล้ว +1

    can you show also what is written in your docker file ?

    • @Techtter
      @Techtter  2 ปีที่แล้ว

      You can see the GitHub link in the description. You can navigate through the Dockerfile of each module.

    • @theprogammerguy2023
      @theprogammerguy2023 2 ปีที่แล้ว +1

      @@Techtter i am following your tutorial but its gives error frontend docker file not found.

    • @Techtter
      @Techtter  2 ปีที่แล้ว

      May be check your docker-compose file whether the base path of scrum-ui project correctly mentioned. Try to give actual path instead of absolute path.

    • @theprogammerguy2023
      @theprogammerguy2023 2 ปีที่แล้ว +1

      @@Techtter how to give it ?

    • @Techtter
      @Techtter  2 ปีที่แล้ว

      Give “c:/project/src “ instead of “./src”. Hope you got it what I mean

  • @jorgeleo52769
    @jorgeleo52769 3 ปีที่แล้ว +1

    Hello good morning, I'm applying this tutorial in a personal project, and don't create the tabs, insert data automatically as you do it in the development stage

    • @Techtter
      @Techtter  3 ปีที่แล้ว

      I am glad it is useful for you..

  • @naveenkumarmaddala7830
    @naveenkumarmaddala7830 3 ปีที่แล้ว +1

    Is Docker Compose will be helpful in communication between microservices?

    • @Techtter
      @Techtter  3 ปีที่แล้ว

      Microservices should have their own interface to communicate with each other like REST API or RPC. In Docker compose yml file you will define network bridge for communication for all Microservices.

    • @naveenkumarmaddala7830
      @naveenkumarmaddala7830 3 ปีที่แล้ว +1

      @@TechtterWithout Docker compose there is no way to communicate between Microservices in docker is it correct?

    • @Techtter
      @Techtter  3 ปีที่แล้ว

      Not like that, Microservices can communicate with each other without Docker Compose also. Docker compose makes it easier to pulling images from registry, configuring and run them from one place, I.e.docker compose yml file.

  • @SamaTV-Review247
    @SamaTV-Review247 4 ปีที่แล้ว +1

    I could be able to create images and generate containers by docker-compose(Spring-boot app PostgreSQL). I got Unauthorized 401. it works in my local machine. any idea?

    • @Techtter
      @Techtter  4 ปีที่แล้ว

      Its a authentication problem. You might have enabled basic security on your spring boot app. Disable it or do the proper security config

    • @Techtter
      @Techtter  4 ปีที่แล้ว

      I think you need to add following lines in application.properties file. If you have .yml file, add it accordingly.
      "security.basic.enable: false security.ignored=/**"

    • @Techtter
      @Techtter  3 ปีที่แล้ว

      Hi Shahrooz... I posted a new video on AWS Lambda. Watch it and like the video. I am planning to more videos on AWS Services. Let me know your opinion on it.

  • @alankaiko
    @alankaiko 2 ปีที่แล้ว +1

    niiiiiiiiiice

    • @Techtter
      @Techtter  2 ปีที่แล้ว

      Thank you

  • @hermannchefouetmeka5929
    @hermannchefouetmeka5929 2 ปีที่แล้ว +1

    😊