Build image in local
$docker image build -t flask_docker .
Run the image
$docker run -p 5000:5000 -d flask_docker
Check the Dockerfile to start the app.
Use Docker Desktop to overview and manage all containers and images.
run Python file to test
$FLASK_APP=app flask run
Edit requirements.txt to add more dependencies.
First, create a repo in Docker Hub
Then in the local terminal, run: docker login -u YOUR-USER-NAME
to login
Next, tag the local image to rename: docker tag local-name YOUR-USER-NAME/new-name
Finally, push: docker push YOUR-USER-NAME/new-name
https://docs.docker.com/get-started/04_sharing_app/
Add gunicorn into the requirements.txt, then create a new empty repo and push files to it.
Set the repo as remote, and then use DigitalOcean to access the repo and then build and deploy.
https://docs.digitalocean.com/tutorials/app-deploy-flask-app/
Remote repo: https://github.com/Leo-rq-yu/weather-forecast.git
Website: https://stingray-app-i8a35.ondigitalocean.app/weather-forecast2