☁️Deployment of Python Flask Website Project on Huawei Cloud ECS Service
Introduction
Hello Everyone!
Today, we will create the website with Flask and run this project on our ECS service.
What is ECS?
An Elastic Cloud Server (ECS) is a basic computing unit that consists of vCPUs, memory, OS, and Elastic Volume Service (EVS) disks.
You can create an ECS by specifying its vCPUs, memory, OS, and login mode. After creating an ECS, you can use it on the cloud like using your local PC or physical server. You can also modify its specifications if necessary. ECS lets your applications run in a reliable, secure, efficient computing environment.
What is Flask?
Flask is a web framework, it’s a Python module that lets you develop web applications easily. It’s has a small and easy-to-extend core: it’s a microframework that doesn’t include an ORM (Object Relational Manager) or such features.
It does have many cool features like url routing, template engine. It is a WSGI web app framework.
Create ECS
Before create ECS We need VPC and security Group with 80 and 5000 port. After that, we buy ECS like image shown below.
We made the adjustments shown in the image. You can follow these steps for ECS installation.
Next configurations
Keep Going like images.
Finally, submitted ECS.
Login ECS
After purchase ECS, ECS must shown as below. You can see login button and EIP address on ECS list. Do remote login.
The image shows ECS virtual machine and commend input page.
login : root
password: your_password
Now you are in your machine, we can start setup our project.
git clone <repo-url> /// get your project
//you can access my sample repo
https://github.com/ibrahimsamed/Flask-Web-App-Tutorial.git
We will run main.py file and main file must include copy commands are for access with EIP. I will change main file if command line with on right code.
We need our project library and tools (requirements), and install all of them automatically
pip install -r requirements.txt
Run python code,
python main.py
After run code we control on own browser, as you see I accessed my flask website page with ECS EIP address from 5000 port