Skip to content

About

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Repository files navigation

docker-python-example

A small Flask web service that runs in a Docker image, with a test and a CI/CD pipeline. It's the companion repository to two free articles on Python Land:

Both are part of the Python tutorial at Python Land.

Run it

With uv:

uv run gunicorn --bind 0.0.0.0:8000 app:app

With Docker, build the image yourself:

docker build -t my_webservice .
docker run -p 8000:8000 my_webservice

or run the image this repository's pipeline publishes:

docker run -p 8000:8000 ghcr.io/eriky/docker-python-example:latest

Then open http://localhost:8000.

Test it

uv run pytest

Every push to main runs the tests and the Ruff linter on GitHub Actions. When they pass, the pipeline builds the image for amd64 and arm64 and publishes it to the GitHub Container Registry.

Before November 2026 this repository used Pipenv. That version is still in the Git history.

About

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages