- Docker and Docker Compose (for example, Docker for Windows)
- GitHub and DockerHub (CI/CD)
Up and running dev environment:
docker-compose up --build -d
Python version: 3.7.7 (python:3.7.7 docker image in Dockerfile, change it if you want another version!)
In order to deploy flask app container to test and shared the application (or deploy it in production), we can push an image to docker hub automatically when commit occurs (continuous integration). Moreover, it is also posible to run test before push to DockerHub automatically with docker-compose.test.yml file.
→ docker blog ←
We have to create a Docker Hub repository (for example, flask-dev) and configure it as shown below:
We have configurated two rules:
- Push image always when commit occurs with latest tag
- Push release image (release-x.x.x) when a new release is generated in the github repo with tag x.x.x
docker run -d -p 5000:5000 itarano/flask-dev:release-1.0.0
This shows how easy is to deploy or test new releases in any kind of environment.
In the directory .github/workflows there is a file to define ci/cd pipeline with Github Actions (test)