In recent years, containerization has become more popular and widely used by software developers. Docker is still considered one of the top tools for creating containers by building Images between containerization platforms or cloud platforms. Containerizing is all about bundling up a software application/service and isolating it from the host environment to run everywhere, be it an AMD or an ARM. Docker Cloud hosting has made it simple to bundle and share containers.
There will be situations where one wants to host and run these containers online in the cloud. For example, containerizing a webpage app and running it in the cloud to be shared and visible to everyone. Many cloud providers allow you to build containers online for the given application and run it continuously. Alternatively, they allow the user to input the Image file directly and create a container. Let’s discuss the free platforms to deploy and run these Docker containers.
Learning Objectives
This article was published as a part of the Data Science Blogathon.
Hosting containerized applications on the cloud is the best way to share them with others and understand how well they can or must be scaled to make them available to millions of users with no connection lags. Many cloud platforms let you host your Docker containers/applications. However, most platforms are not free, and users are asked for their personal information, such as credit card details. Once, there was a platform called Heroku, which provided free application hosting in the cloud.
Heroku was famous among developers for its free tier and ease of use. But recently, Heroku removed its free tier, and now the time has come for developers to search for its next successor. This article gives you information on four platforms that help you host containerized applications for free on the cloud without charging anything or asking for personal information.
Zeet is a cloud platform for deploying DevOps-operated, production-ready cloud services. With Zeet, any programmer can publish code on production-grade infrastructure, a software platform developed on top of one’s AWS or GCP, thus eliminating complex infrastructure management. It, by default, supports many programming languages like Python, Node, etc.
Zeet allows its users to deploy apps/websites using Dock Containers, which are run in a cluster managed by Zeet. The Docker Image can be directly provided to Zeet for deployment. Zeet is compatible with a range of programming languages.
Zeet has a free plan for developers. The following are included in this free plan:
The following are its disadvantages/limitations:
Zeet is being used by Mythia as a replacement for AWS, thus saving hundreds of development hours. The Fairgrounds company utilizing Zeet is trying to build an entire Metaverse, and the Paper company employs Zeet for checkout solutions.
Fly.io is a new public cloud that makes it simple to deploy/publish real-time apps close to target users, regardless of whether they might be present in the world. It is based on bare-metal servers that operate in data centres all over the world. Fly.io’s main motto is to deliver apps to end users with high availability and low latency.
Fly.io doesn’t have a free plan or free tier in its pricing section, but it allows users to provide enough resources to run small full-stack websites/applications for free. One can host Dock Containers on this website.
Fly.io takes in the application and its Dockerfile, which the user wants to host. Then, based on the Dockerfile, it builds the image and hosts the following container. The user can provide the pre-built Docker Image if it already exists. The free tier includes the following:
The free tier of fly.io includes the following limitations/disadvantages:
Many websites, such as reactrouter.com, kentcdodds.com, unpkg.com, and aiven.io, host their websites on fly.io, which makes them highly available to users worldwide.
Before working with fly.io, one needs to install their command line tool called flyctl in the host operating system, and it can be done as follows:
# Installing flyctl in windows
$ powershell -Command "iwr https://fly.io/install.ps1 -useb | iex"
# Installing flyctl in Linux
$ curl -L https://fly.io/install.sh | sh
# Installing flyctl in Mac
$ brew install flyctl
Render is a fully managed seamless cloud platform for running an app or website. It provides a free TLS certificate, private network, and global CDN. Render offers various features, like managed databases, one-click deployments, automated scaling, and an easy-to-use UI. It also allows easy integration with development tools like Docker Containers and GitHub. Render provides native support for hosting containerized apps and services at scale.
Render has a free tier plan, which is a free tier plan that increases and complex computations can then be upgraded. The free tier plan includes the following:
Disadvantages of using Render include:
Companies like Indie Hackers, Pete for America, Zelos, etc., have chosen Render over AWS for its simplicity. It eliminates a lot of infrastructure complexity and helps them with automatic builds and zero downtime deployment.
The Railway is a cloud-based deployment platform that enables users to publish and host applications in the cloud. The railway manages these servers and databases, thus caring for the infrastructure. It supports various languages, including Python, Next.js, Node, and many others.
One of its key features is its support for Docker. During the build process, the Railway app looks for a Dockerfile to build an image for the application based on its configuration and run the following container in the cloud.
The railway comes with a free-tier plan, which includes the following:
Disadvantages/limitations associated with this cloud platform include:
Railway is employed by companies like Atmos, which deals with real estate home customization, and Zora, a company related to NFTs. Fion Tech provides Machine Learning models for fire prediction, Operand, and many more.
Let’s try deploying a simple Flask application to one of the platforms above. Here, we will deploy it to the Render platform. Let’s look at the sample code and the Dockerfile.
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello Flask App'
if __name__ == "__main__":
app.run(debug=True)
The above code will start a flask server and display the message “Hello Flask App.” Below is the Dockerfile, which will help build an Image for the simple Flask app. Upload both of these files to a GitHub Repository.
FROM python:3.10-slim
WORKDIR /flask_app
COPY . .
RUN pip install -r requirements.txt
ENV FLASK_DEBUG=1
EXPOSE 5000
CMD ["flask","run","--host=0.0.0.0"]
Thus, the app is working perfectly. This way, one can create an application and then create a respective Dockerfile, which Render uses to build an Image out of it and run it on the cloud.
Creating an application is one task, and deploying that on the cloud as a container is another. Most of the cloud platforms do not support Docker/containerization. They don’t usually have free tiers/plans, even if they support them. Cloud services like AWS/GCP allow you to deploy these Containers but ask the user to enter their credit card details. So this article focuses on those websites/cloud services that support containerization and allow users to host them for free without providing a credit card and personal information.
Some of the key takeaways from this article include the following:
A. You can run Docker containers for free on cloud platforms like Zeet, Fly.io, Render, and Railway. These platforms provide free tiers for developers, allowing Docker container hosting without payment information. Each platform offers unique features, from edge computing to serverless infrastructure and built-in security measures.
A. The best platform to run Docker depends on your requirements. Render is highly recommended for security and seamless deployments, while Fly.io offers edge hosting for low latency. Zeet provides developer-friendly serverless options, and Railway has a straightforward UI with a free $5 credit for new users.
A. Docker containers can be in one of four states: created, running, paused, or stopped. Created containers have been initialized but not started. Running containers actively perform tasks, while paused containers are temporarily inactive. Stopped containers have finished or ceased execution and await further commands.
A. Docker can run multiple containers, limited by the system’s resources such as CPU and RAM. Technically, there’s no hard limit, but the maximum number depends on the server’s capabilities. Docker’s lightweight nature allows efficient scaling, so systems can often run hundreds of containers simultaneously.
The media shown in this article is not owned by Analytics Vidhya and is used at the Author’s discretion.