Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 17, 2021 02:25 pm GMT

How to deploy your NodeJS / Flask application to Qovery in less than five minutes

All my prayers have been answered once I found Qovery. It's a super affordable hosting service that is amazingly powerful and gives you maximized ease.

If you are still clinging to Heroku, Netlify, Terraform, etc; consider reading these articles.

Okay, so that being said, I will show you how to deploy a nodeJS and python application to Qovery in less than five minutes.

Deploying a NodeJS Application

I'm assuming you've already signed up for Qovery, developed your app, and put all the code into a github repository. Those are the main steps you need to do and the rest is a breeze.

The next step is to create a file called Dockerfile in your application. Assuming you are deploying an expressJS app, your dockerfile should look like this:

FROM node:14RUN mkdir -p /usr/src/appWORKDIR /usr/src/appCOPY . .RUN npm installEXPOSE 3000CMD ["node", "index.js"]

Also, you don't even need to have docker installed. Qovery takes care of all that for you.

After that, push to the git repo and update it. Next, you're going to want to create a new project on your qovery console.

Next, create an environment in that project.

Add your first app, connect to the correct git repo, and finally, a very important step, set the build mode to Docker, and set the port to 3000.
You can technically use a different port to add your app on, but in this tutorial, let's use 3000. Make sure your app is listening on that port!!

If you want to change that port, make sure you change the code in your dockerfile, the EXPOSE 3000 to EXPOSE <your-port>.

Screen Shot 2021-09-17 at 9.11.45 AM

Update your settings if you want, then click the Actions button and then deploy your app. Once it's in a RUNNING state, your app is ready!!
Screen Shot 2021-09-17 at 9.16.46 AM

Deploying your Python Flask app

Sign up for qovery, create your project, and then link it to a github repo. Add your dockerfile into your app. It should look like this:

FROM python:3.8-slim-busterWORKDIR /usr/src/appCOPY . ./RUN pip install -r requirements.txtEXPOSE 3000CMD ["python","app.py"]

Make sure your app is listening on port 3000. You don't need to install docker.

Push your code to the git repo, create a new project, a new environment, and then an app. Make sure the build mode is Docker and not Buildpacks.

Click the Actions button, deploy your project, and you should be ready to go.

I hope qovery is something you'll be enjoying from now on. It is something that is super amazing, secure, and reliable.

Don't forget to follow the Founder of Qovery on DEV!

Happy Coding (and deploying)!


Original Link: https://dev.to/leviathanprogramming/how-to-deploy-your-nodejs-flask-application-to-qovery-ld3

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To