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

  Рет қаралды 2,410

TrickSumo

TrickSumo

Күн бұрын

Deploy LangChain and Flask Application Using Github Actions and AWS EC2 (Gunicorn & Nginx)
Steps:-
1. Create EC2 instance.
2. Add GitHub env variables.
3. Add GitHub actions, deployment script, and requirements.txt
Github action file:- github.com/Tri...
Bash Script:- github.com/Tri...
#python #flask #langchain #django #deployment #awsec2

Пікірлер: 5
@user-cs6jl9hs2c
@user-cs6jl9hs2c 6 ай бұрын
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 6 ай бұрын
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 4 ай бұрын
Does this require you to push the generated .env file to your github repo?
@TrickSumo
@TrickSumo 4 ай бұрын
No, env variables are stored as GitHub repo environment secret. kzbin.info/www/bejne/jWnXgIGbd9qHpJI These secrets are used to create .env file dynamically. So your keys are never exposed publically.
@TrickSumo
@TrickSumo 6 ай бұрын
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"
Deploy a Django web app with Nginx to Amazon EC2
35:26
Cloud With Django
Рет қаралды 42 М.
Modus males sekolah
00:14
fitrop
Рет қаралды 16 МЛН
Dad gives best memory keeper
01:00
Justin Flom
Рет қаралды 21 МЛН
Chat With PDFs Using The RetrievalQA Chain In LangChain
43:30
Creating a Flask Web Server in EC2 on the AWS Free Tier from scratch!
17:28
Host a Free Uptime Monitor on Github
11:03
Bufferhead
Рет қаралды 14 М.
AWS Tutorials: Deploy Python Application on AWS EC2 (Permanent Running)
19:45
Machine Learning Hub
Рет қаралды 91 М.
Modus males sekolah
00:14
fitrop
Рет қаралды 16 МЛН