Flask App in Docker

Install Docker.

sudo apt update &&
sudo apt install apt-transport-https ca-certificates curl gnupg  software-properties-common &&
sudo curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - &&
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" &&
sudo apt install docker-ce &&
sudo systemctl status docker

Pull an example.

sudo docker pull heddle317/docker-flask-example &&
sudo docker run -p 8080:80 -e ENVIRONMENT='production' -d --name=flask_app heddle317/docker-flask-example &&
sudo curl localhost:8080

Result:

hello world!

Finish.

Thank you, Heddle.

Advertisements