Docker container allowing you to build and test your Python project. This container mainly targets Python web project developments but you can try to make it work with your project even if your project is not using web technologies.
Dockerfile
links3.8
, latest
(3.8/Dockerfile)3.7
(3.7/Dockerfile)3.6
(3.6/Dockerfile)poetry
is installed in every image to make Python dependencies installation easier. pipenv
is also installed if you prefer to use this solution for dependencies management.
The following dependencies are installed to make wheel installation work properly:
g++
, gcc
, make
and libc6-dev
)We recommend you to use the dev
user instead of root
when running that container.
The container's working directory is /var/www/app
so we advise you to mount your project directory onto this place.
To run the container and open a bash in your python project run the following command:
docker run -it --entrypoint /bin/bash --user=dev --volume=<path-to-your-python-project-directory>:/var/www/app groovytron/python:latest
python
or python3
pip
or pip3
poetry
or pipenv
Note: as the PIPENV_VENV_IN_PROJECT
environment variable is set, pipenv
will create the virtual environment in a folder called .venv
in your project directory. This configuration is applied to root
and dev
users.
Note: as poetry's configuration is contained into config/poetry/config.toml and virtualenvs.in-project
is set to true
, poetry
will create the virtual environment in a folder called .venv
in your project directory. This configuration is applied to root
and dev
users.
Pull requests, bug reports, and feature requests are welcome.
If you want to improve one of these images, you will need the following software installed on your system:
docker
docker-compose
(if you want to build images using the file build.yml)make
(if you want to build images using the file build.yml and abstract from it with the Makefile)Once you have the above softwares installed, run make python3.7
to build the python3.7
image. To build all the images, run make all
. If you want to clean your builds, simply run make clean
.
MIT License. See the LICENSE file.