Загрузка страницы

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
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
30 декабря 2020 г. 4:52:05
00:06:59
Яндекс.Метрика