---
title: "Discussion on \"Containerize your web application & deploy it on Kubernetes\" | Hashnode"
description: "Discussion on \"Containerize your web application & deploy it on Kubernetes\". Learn how to create a docker image of any web application using Dockerfile and later deploy it on Kubernetes"
url: "https://hashnode.com/posts/containerize-your-web-application-and-deploy-it-on-kubernetes/5f9fb419de85d46a77d5efe6"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Containerize your web application & deploy it on Kubernetes](https://apoorvtyagi.tech/containerize-your-web-application-and-deploy-it-on-kubernetes?utm_source=hashnode&utm_medium=feed)

Learn how to create a docker image of any web application using Dockerfile and later deploy it on Kubernetes

Nov 2, 2020 · 6 min read · apoorvtyagi.tech  
Updated Mar 5, 2023  
Read the article

-   [#programming](https://hashnode.com/tag/programming)
-   [#python](https://hashnode.com/tag/python)
-   [#tutorial](https://hashnode.com/tag/tutorial)
-   [#docker](https://hashnode.com/tag/docker)
-   [#kubernetes](https://hashnode.com/tag/kubernetes)

## Written by

[Apoorv Tyagi](https://hashnode.com/@apoorvtyagi)

@apoorvtyagi · India

  
[View profile](https://hashnode.com/@apoorvtyagi)

Senior Software Engineer | Tech Blogger | !(Chess GM)

Senior Software Engineer. I write about practical tips and epic stories about my experiences in the field of computer science and engineering!

## Responses 3

Markdown supported · ⌘↵ to post

[Nimrod Kramer](https://hashnode.com/@nimrodkramer)

[Nov 3, 2020](https://hashnode.com/posts/containerize-your-web-application-and-deploy-it-on-kubernetes/5f9fb419de85d46a77d5efe6/comment/5fa10c21ad30887ef1e166c7)

Congrats on being featured on daily.dev! Good job there.

[Apoorv Tyagi](https://hashnode.com/@apoorvtyagi)

[Nov 3, 2020](https://hashnode.com/posts/containerize-your-web-application-and-deploy-it-on-kubernetes/5f9fb419de85d46a77d5efe6/comment/5fa10c21ad30887ef1e166c7#reply-5fa10faaa5f5117f1201fd58)

Thank You so much [Nimrod Kramer](https://hashnode.com/@nimrodkramer) :)

[Matt Moll](https://hashnode.com/@MattCodeJourney)

[Nov 2, 2020](https://hashnode.com/posts/containerize-your-web-application-and-deploy-it-on-kubernetes/5f9fb419de85d46a77d5efe6/comment/5fa05455701b426a98096cff)

Nice article Apoorv! Keep them coming!

[Apoorv Tyagi](https://hashnode.com/@apoorvtyagi)

[Nov 3, 2020](https://hashnode.com/posts/containerize-your-web-application-and-deploy-it-on-kubernetes/5f9fb419de85d46a77d5efe6/comment/5fa05455701b426a98096cff#reply-5fa0ca56ad30887ef1e1631e)

Thanks [Matt Moll](https://hashnode.com/@MattCodeJourney).

I will for sure! I have quite a few ideas in my head that are soon coming on my blog 😊

[Kannan](https://hashnode.com/@rbkannan1)

[Nov 2, 2020](https://hashnode.com/posts/containerize-your-web-application-and-deploy-it-on-kubernetes/5f9fb419de85d46a77d5efe6/comment/5f9fb914de85d46a77d5f04d)

[Apoorv Tyagi](https://hashnode.com/@apoorvtyagi) Thanks for the great article. Wondering what is the use of this docker run **\-dp 5000:5000** hello-python. Since we specify that we want to expose the port 5000 in dockerfile.

[Kannan](https://hashnode.com/@rbkannan1)

[Nov 2, 2020](https://hashnode.com/posts/containerize-your-web-application-and-deploy-it-on-kubernetes/5f9fb419de85d46a77d5efe6/comment/5f9fb914de85d46a77d5f04d#reply-5f9fc9e7de85d46a77d5f187)

[Apoorv Tyagi](https://hashnode.com/@apoorvtyagi) Thanks. just another small question why :5000 next to 5500 if port is 5500

[Apoorv Tyagi](https://hashnode.com/@apoorvtyagi)

[Nov 2, 2020](https://hashnode.com/posts/containerize-your-web-application-and-deploy-it-on-kubernetes/5f9fb419de85d46a77d5efe6/comment/5f9fb914de85d46a77d5f04d#reply-5f9fe242de85d46a77d5f33a)

[Kannan](https://hashnode.com/@rbkannan1) 5500 is the container port that we published. Publishing ports means mapping container ports to the host application(my flask app in this case) so that the ports are available to services outside of Docker container.

In order to do that the syntax is `docker run -p <your container port>:<host app exposed port><imageName>`

This means anyone connecting to the host(flask app) over port 5000 will be routed to my container via port 5500.

[Kannan](https://hashnode.com/@rbkannan1)

[Nov 2, 2020](https://hashnode.com/posts/containerize-your-web-application-and-deploy-it-on-kubernetes/5f9fb419de85d46a77d5efe6/comment/5f9fb914de85d46a77d5f04d#reply-5f9fe6ff701b426a98096661)

[Apoorv Tyagi](https://hashnode.com/@apoorvtyagi) Got it. Thanks for the detailed explanation.
