Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deploy the code in Azure Web App #80

Open
ashwin-i2sts opened this issue Aug 25, 2020 · 4 comments
Open

How to deploy the code in Azure Web App #80

ashwin-i2sts opened this issue Aug 25, 2020 · 4 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested

Comments

@ashwin-i2sts
Copy link

please help me out with deployment of the code in Azure Web App.

@santiq
Copy link
Owner

santiq commented Aug 25, 2020

Honestly I don’t know, never used azure.
But I can provide instructions for aws elastic beanstalk, aws ec2, heroku, now.sh, or digital ocean.

@santiq santiq added good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested labels Aug 25, 2020
@ashwin-i2sts
Copy link
Author

ashwin-i2sts commented Aug 26, 2020 via email

@santiq
Copy link
Owner

santiq commented Aug 28, 2020

Hey, Sorry I didn't see the notification.

So let's start with the most simple one, Heroku which is what I'd recommend if you are hosting an app with little load, ideally when you are starting out. Just keep it simple and don't waste your time with hosting node.js apps since moving from Heroku to AWS is fairly simple and straightforward with the right instructions.

Basically you have to create a Procfile (that exact name, without file extension, in the project root) with the command for starting your application, for example for this repo would be:

web: npm run start

But also, since we are using typescript, we need first a step that transpiles it to javascript
Heroku has a "hook" or a step that we can use to our advantage. Just put this on your package.json

    "build": "tsc && nuxt build",
    "heroku-postbuild": "npm run build",

Now that we have the codebase ready for deployments to Heroku, the next would be to create a Heroku account and a Heroku app. You can look that up in google.

But what's important here is to understand how Heroku works, they basically expose a Git server. So you add a new "remote" for your codebase and push your changes there.

git remote add heroku https://your-url-of-hero/whatever.git

Then to deploy changes

git push heroku master # notice 'heroku' is the name of the remote and 'master' the name of the branch.

For now.sh the process is almost identical, they are like a cheaper alternative to Heroku and use Procfile as well.

@santiq
Copy link
Owner

santiq commented Aug 28, 2020

As for AWS EC2 and Digital Ocean

When you create an instance in EC2 you are purchasing a complete O.S, and you have to take care of it, that means setup log rotation, install Nginx, setup port forwarding, and so on.

To deploy something there, you can SSH into the machine IP (look for that in AWS EC2 console) and clone your repo, install dependencies, and spin up the server.
Later you can automatize this process with a Bash script.
It is a great way to hosting your app, you have full control of everything as opposed to what Heroku or now.sh offers.

But this is the reason I prefer to use AWS Elastic Beanstalk

EB is a "High Level" service that glues together 5-6 different AWS services.

With a few clicks, you can have your app running in EC2 with multiple instances to reach High Availability, different types of load balancers and automatic scaling (through EC2 Auto Scaling Groups) and with free SSL certificates (AWS Certificate Manager) and your own domain (AWS Route 53), lastly, Cloud Watch is also added so you can see logs of your instances without login into them

It may seem like I'm promoting AWS but is not, I hate them as much as I love them, and I only recommend them when you are dealing with a production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants