Devops
Devops
Devops
User@Phebe-enoch MINGW64 ~
$ cd .ssh/
$ cat id_rsa.pub
Copy SSH Key and paste it while creating the new Webserver
1. Setup Azure VM
nginx -v
Check with IP: IP From Azure - Check in the Browser with the IP. So the Nginx server
should be Up and Running
5. Install PostGres DB
https://www.postgresql.org/download/linux/ubuntu/
sudo su postgres
psql
command : \password
postgres=# \password
Enter new password for user "postgres":
Enter it again:
Exit : postgres=# exit
postgres@LMSVMServer:/home/azureuser$ exit
Get Branches: git branch -r (Navigate to the LMS-Public folder then search for Git Branches)
git status
sudo rm /etc/nginx/sites-enabled/default
sudo vi /etc/nginx/sites-available/lms-app
server {
server_name konalms.in;
location / {
root /home/azureuser/lms-public/webapp/dist;
}
location /api {
proxy_pass http://localhost:8080;
}
}
Verify whether the LMS files are available under this path:
cd /var/www/html/
If not, then copy the LMS files from Webapp>Dist folder by using the following command
cd lms-public/webapp/dist/
ls
sudo cp -r * /var/www/html/
Restart Nginx
npm install
lms-public>>webapp>>
vi .env
Then again re-run npm run build to make sure that changes are get updated
URL: https://certbot.eff.org/instructions?ws=nginx&os=ubuntufocal
Give Email ID :
Say : Y,Y
Select : 1
npm install
sudo vi .env
MODE=production
PORT=8080
DATABASE_URL=postgresql://postgres:password@localhost:5432/postgres
1. Install VM on Cloud
2. Install Docker
3. Post Install Steps for Docker
4. Setup DB
5. Create FE Images
6. Create FE Docker Files
7. Build Docker FE Images
8. Build Docker BE Images
9. External Nginx for HTTPS, LB
10. Docker Compose, YAML
Installing Docker Images and Containers
1. Setup Azure VM
i. Update the apt package index and install packages to allow apt to use a repository
over HTTPS:
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg
iii. log out and log back in so that your group membership is re-evaluated.
newgrp docker
Get Branches: git branch -r (Navigate to the LMS-Public folder then search for Git Branches)
git status
5. Creating Images:
Creating Network:
Without Network:
With Network:
docker images to check whether the DB Image is created or not and is up and running
When the above is executed along with the Image, the Docker container is also generated.
docker ps to check whether the DB container is created or not and is up and running
To check the application is up and running in the cd use the following command
curl http://localhost:8080/api
nginx -v
sudo rm /etc/nginx/sites-enabled/default
sudo vi /etc/nginx/sites-available/lms-app
server {
server_name konalms.in;
location / {
proxy_pass http://localhost:3000;
}
location /api {
proxy_pass http://localhost:8080;
}
}
URL: https://certbot.eff.org/instructions?ws=nginx&os=ubuntufocal
Give Email ID :
Say : Y,Y
Select : 1
VITE_API_URL=https://bhagyadevops.in/api
docker ps
docker container stop <<dockerfile name/container ID>>
docker container rm <<dockerfile name/container ID>>
Now the Docker Image should be removed for the stopped container
Now we have changed the FE path, we need to re-build and re-run the docker FE with the
Port number adding into it
sudo vi .env
MODE=production
PORT=8080
DATABASE_URL=postgresql://postgres:password@localhost:5432/postgres