How to build Docker Images for a Flask App
I walk through how to Dockerize an existing Python Flask web application by creating the Dockerfile and running the appropriate commands. Link to public Github repo: https://github.com/vastevenson/docker-flask-test
Here are the steps:
Create a Flask app
Confirm the flask app can run
Add a Dockerfile to the src dir
Run command from terminal: docker image build -t docker-flask-test . (don’t miss the last .)
Run command: docker run -p 5000:5000 -d docker-flask-test
Note: we are binding the host port 5000 to the container port 5000. We are also running in detached mode so the terminal shows up in separate window and naming the container.
You will see the container ID appear, you can see the logs by typing in: docker container logs [Image ID]
docker container stop [ID] will stop the container
docker system prune will remove any stopped containers, unused volumes and networks, and dangling images.
Special thanks to Tasnuva Zaman: https://medium.com/@tasnuva2606/dockerize-flask-app-4998a378a6aa
Видео How to build Docker Images for a Flask App канала Vincent Stevenson
Here are the steps:
Create a Flask app
Confirm the flask app can run
Add a Dockerfile to the src dir
Run command from terminal: docker image build -t docker-flask-test . (don’t miss the last .)
Run command: docker run -p 5000:5000 -d docker-flask-test
Note: we are binding the host port 5000 to the container port 5000. We are also running in detached mode so the terminal shows up in separate window and naming the container.
You will see the container ID appear, you can see the logs by typing in: docker container logs [Image ID]
docker container stop [ID] will stop the container
docker system prune will remove any stopped containers, unused volumes and networks, and dangling images.
Special thanks to Tasnuva Zaman: https://medium.com/@tasnuva2606/dockerize-flask-app-4998a378a6aa
Видео How to build Docker Images for a Flask App канала Vincent Stevenson
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![Learn Docker in 7 Easy Steps - Full Beginner's Tutorial](https://i.ytimg.com/vi/gAkwW2tuIqE/default.jpg)
![Containerizing Python web apps with Docker, Flask, Nginx & uWSGI](https://i.ytimg.com/vi/dVEjSmKFUVI/default.jpg)
![Build YOUR OWN Dockerfile, Image, and Container](https://i.ytimg.com/vi/SnSH8Ht3MIc/default.jpg)
![Convert Python Flask APP to Docker Container | Docker | Python Flask](https://i.ytimg.com/vi/prlixoDIfrc/default.jpg)
![Docker For Beginners: From Docker Desktop to Deployment](https://i.ytimg.com/vi/i7ABlHngi1Q/default.jpg)
![Docker Tutorial for Beginners [FULL COURSE in 3 Hours]](https://i.ytimg.com/vi/3c-iBn73dDE/default.jpg)
![Docker Tutorial For Beginners - How To Containerize Python Applications](https://i.ytimg.com/vi/bi0cKgmRuiA/default.jpg)
![Dockerfile Tutorial - Docker in Practice || Docker Tutorial 10](https://i.ytimg.com/vi/WmcdMiyqfZs/default.jpg)
![Docker Compose in 12 Minutes](https://i.ytimg.com/vi/Qw9zlE3t8Ko/default.jpg)
![Docker Tutorial for Beginners](https://i.ytimg.com/vi/pTFZFxd4hOI/default.jpg)
![Docker VSCode Python Tutorial ▶️ Run your App in a Container](https://i.ytimg.com/vi/jtBVppyfDbE/default.jpg)
![Microservices in Python using Flask Framework | Dockerize and Deploy to Kubernetes with Helm](https://i.ytimg.com/vi/SdTzwYmsgoU/default.jpg)
![Kaniko - Building Container Images In Kubernetes Without Docker](https://i.ytimg.com/vi/EgwVQN6GNJg/default.jpg)
![Python Tutorial | Connecting Flask and Nginx with Docker](https://i.ytimg.com/vi/Vkqz2hK4fKg/default.jpg)
![Flask Tutorial #1 - How to Make Websites with Python](https://i.ytimg.com/vi/mqhxxeeTbu0/default.jpg)
![Python Flask Tutorial: Full-Featured Web App Part 9 - Pagination](https://i.ytimg.com/vi/PSWf2TjTGNY/default.jpg)
![How to run and host Flask in a Docker container](https://i.ytimg.com/vi/9tErxxGpOM4/default.jpg)
![How to Containerize a Flask application using Docker? | P-1](https://i.ytimg.com/vi/jZB6OaHvPEQ/default.jpg)
![Docker for NET Developers: Dockerfile Basics](https://i.ytimg.com/vi/grbc8mevLRc/default.jpg)
![How to Deploy a Docker App to AWS using Elastic Container Service (ECS)](https://i.ytimg.com/vi/zs3tyVgiBQQ/default.jpg)