In this repo, I will introduce how to use Docker to support Python project/application development and provide some prototypes that can be used for your development. Feel free to fork this repo and create your own Docker container!
Just need to install Python and Docker and follow this book!
- How to set up a reproducible development environment using Docker for Python
- How to develop your Python code interactively with Docker
If you are new to Docker, you can follow this hello world example to have a first try.
- Clone this repository
git clone https://github.com/ZequnZ/python-x-docker-handbook.git
- Change your current directory to this repo
cd python-x-docker-handbook
- Build the Docker container
docker build -t py-x-docker .
- Execute the container
docker run py-x-docker
Then you will see my welcome message.
I also use Makefile to make life easier so that you do not need to remember the full command:
- Build the Docker container:
make build
- Execute the container:
make run
That is the way to put your Python code into a Docker container
It is simple, isn't it? If you want to know more about how to utilize Docker to support your python development, just follow this repo and I will show more interesting use cases!
Content:
- how to run your Python code interactively with a Docker container
- volumn
- --publish , -p Publish a container's port(s) to the host
- docker-compose
- how to dockerize an python application
- 1 + 2
- The power of docker-compose
- mocked service