DigitalOcean droplet zero downtime deploy - digital-ocean

I've deployed Django app in Digitalocean droplet.
How can I deploy a new version of the app and make the old version still work, while I'm pulling out from git and deploying it?
In DigitalOcean app it works automaticaly.

Related

how to deploy MERN app using docker compose to Google cloud platform?

I just started exploring docker and other devOps stuffs. I am currently wokring on a website which is built with react and node js with mongodb atlas as database. For deployment I am using Google cloud platform. The frontend and backend is containerized and served using nginx. The primary goal was to run the site in a single domain, the server is proxypassed using nginx.
The issue is, this site is taking too long to load. I have used docker compose to build and run the whole app in the gcp. The app is running on a VM created on google compute engine, server location is us-canada.
Running the client part of this website on google cloud run or app engine is very fast in loading but I'm not getting why is it taking this much loading time on VM? I'm not sure what I'm doing wrong here.
my site url: www.mindschoolbd.com

SpringBoot 2.5.3 does not work on AWS Elastic Beanstalk

I'm attempting to upgrade SpringBoot from v2.4.0 to 2.5.3.
My Boot project installs and runs fine locally with both versions.
Version 2.4.0 works fine on Beanstalk. When updating to 2.5.3 however, nginx returns a 301 for all requests to the Boot application. I am testing on the same instance (so same config) on Corretto 11 running on 64bit Amazon Linux 2/3.2.7.
The SpringBoot logs are identical between the 2 when starting up on both local and SpringBoot minus a few verbiage changes. No other changes exist in the code.
I'm a bit stuck. I've reviewed the Java logs, nginx, Beanstalk init logs, and everything looks fine.
Edit I am looking for suggestions on troubleshooting next steps for AWS Beanstalk SpringBoot apps as the 2 version produce identical EB and app logs, and I am not sure where else I should be looking.

How to add a SQLite database in AWS?

I have created a flask application that uses a sqlite database in local system. It works fine.
I wanted to deploy this application on AWS on Elastic Beanstalk service. The application is deployed successfully using GitHub actions and Elastic Beanstalk. However, when I try to access the database, it shows Internal Server Error.
I know that to locally create the database, we need to run the following 3 commands -
flask db init
flask db migrate -m "Message"
flask db upgrade
But where should I mention and run these commands in Elastic BeanStalk? Should I mention them in the main.yml file?

How can automatic deploy yii2 app when Elastic Beanstalk instance is terminated and created a new instance

Currently I have setup my yii2 website on AWS Elastic beanstalk. I followed following steps :
Created Elastic Beanstalk app and environment : Platform PHP 7.0, RDS database
Created SSH connection from EC2 instance of elastic beanstalk using putty with .pem file
In Apache folder I have cloned my yii2 git repo using (sudo git clone repo_url) command
Installed composer using this link https://gist.github.com/asugai/6694502
Run command : (sudo composer install) in my repo folder
Edited common/config/main-local.php and made db connection
And run migration using (sudo php yii migrate)
Setup a domain for this elastic beanstalk app
Now I don't know how should I proceed further and I am facing following problems :
Elastic Balance loader is creating new instance and terminating current one when it fails or health goes in severe.
Due this, my all data in that instance is lost. To make it work I am doing all steps again and again manually.
How can I make my domain https (SSL certified)
How can make easy process to pull new changes from git
I already have a working site in nodeJS. which is using elastic beanstalk, elastic balance loader, RDS(postgres), S3 bucket, cloudfront for Route 53, SSL certificate (https), code pipeline, code commit. And AWSCLI at local to deploy nodeJS app.
my question is about I want to use same flow for yii2 advance app.
Can anyone please help me here?
Thanks in advance :)

manage migrations when deploy rails app with AWS Elastic Beanstalk

AWS Elastic Beanstalk is easy to use for deploying rails app on Amazon EC2. By set RAILS_SKIP_MIGRATIONS as true, eb won't run the migrations itself so I can manage migrations myself.
However,SSH to the EC2 instance that created by Beanstalk, I can't find the deployed rails app in the home directory.Then I don't know where to manually rake the migrations.
I wonder why the rails app can't be found on the EC2 instance since the instance is the web server to host the app. Is it hidden somewhere? And how should I manually rake the migrations?
Thanks
Try take a look at /var/app/current.
I think you can't find rake, because elastic beanstalk run ruby environment in virtual environment - rvm. Try to find in the directory /opt environment variables which set up ruby environment for current terminal. I'm not sure for ruby, but for python you should do: source /opt/python/current/env.