Python Web App CI/CD Using Github Actions and AWS EC2 | Deploy Langchain Flask Django App On Server

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

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

  • @utkarshagrawal-t4w
    @utkarshagrawal-t4w 11 หลายเดือนก่อน +1

    thanks for the guide its working but i want to ask do we really have to delete the whole project and recopy it everytime we push what if project is big and change is very small do we still have to do the same process or there is any other efficient way

    • @TrickSumo
      @TrickSumo  11 หลายเดือนก่อน +2

      Hi
      In GitHub action, "rsync" command can be used instead of "src" (line 37 of deploy.yaml):-
      rsync -avz --delete ./ $EC2_USERNAME@$EC2_HOST:/var/www/langchain-app
      After that "sudo mv * /var/www/langchain-app" command from bash script can be removed:- github.com/TrickSumo/langchain-course-python/blob/16-CICD-PYTHON-WEBAPP/deploy.sh#L10

  • @EVM-YT
    @EVM-YT 9 หลายเดือนก่อน +1

    Does this require you to push the generated .env file to your github repo?

    • @TrickSumo
      @TrickSumo  9 หลายเดือนก่อน

      No, env variables are stored as GitHub repo environment secret. th-cam.com/video/W8tONeBuTn0/w-d-xo.html
      These secrets are used to create .env file dynamically.
      So your keys are never exposed publically.

  • @TrickSumo
    @TrickSumo  11 หลายเดือนก่อน

    Home Work hint =>
    1. To get instance IP address in the bash script, use:-
    curl 169.254.169.254/latest/meta-data/public-ipv4
    (make sure to do:- EC2 instance >> Instance settings >> Modify instance metadata options >> IMDSv2 >> Optional)
    2. Use "sed" Linux command to search and replace IP address in the "index.html"