🐳 Python image that includes UV and a dev variant with tools (Ruff, Trivy, ...)
7.7K
py-uv-genesis is a 🐳 Docker-based Python development environment that includes various tools for Python development, dependency management, and security scanning. It's designed to supercharge your Python projects! 🔋
# For base versions (replace X.Y with 3.9, 3.10, 3.11, 3.12 or 3.13)
docker build -t py-uv-genesis:X.Y -f Dockerfile.base --build-arg PYTHON_VERSION=X.Y .
# For development versions (replace X.Y with 3.9, 3.10, 3.11, 3.12 or 3.13)
docker build -t py-uv-genesis:X.Y-dev -f Dockerfile.dev --build-arg PYTHON_VERSION=X.Y .
# For base versions
docker run -it --rm py-uv-genesis:X.Y
# For development versions
docker run -it --rm py-uv-genesis:X.Y-dev
Examples:
# Build and run Python 3.9 base version
docker build -t py-uv-genesis:3.9 -f Dockerfile.base --build-arg PYTHON_VERSION=3.9 .
docker run -it --rm py-uv-genesis:3.9
# Build and run Python 3.9 development version
docker build -t py-uv-genesis:3.9-dev -f Dockerfile.dev --build-arg PYTHON_VERSION=3.9 .
docker run -it --rm py-uv-genesis:3.9-dev
This will start an interactive Python shell. You can modify the CMD in the Dockerfile to run your specific Python script or application.
You can customize the Dockerfiles to add or remove tools as needed for your project. The current setup provides a solid foundation for Python development with security scanning capabilities in the development versions, and a lightweight environment with uv in the base versions.
hello.py:print("Hello from py-uv-genesis!")
docker run -it --rm -v $(pwd):/app py-uv-genesis:3.11-dev python /app/hello.py
requirements.txt file:requests==2.26.0
docker run -it --rm -v $(pwd):/app py-uv-genesis:3.11-dev sh -c "uv pip install -r /app/requirements.txt && python /app/your_script.py"
Run Trivy to scan your project for vulnerabilities:
docker run -it --rm -v $(pwd):/app py-uv-genesis:3.11-dev trivy filesystem /app
Start an interactive Python shell with all tools available:
docker run -it --rm py-uv-genesis:3.11-dev
py-uv-genesis can be easily integrated with VS Code Dev Containers for a seamless development experience.
Install the "Remote - Containers" extension in VS Code.
Create a .devcontainer folder in your project root.
Add a devcontainer.json file in the .devcontainer folder:
{
"name": "py-uv-genesis",
"image": "py-uv-genesis:3.11-dev",
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.ruffEnabled": true,
"python.formatting.provider": "ruff"
},
"postCreateCommand": "uv pip install -r requirements.txt"
}
This setup will provide you with a fully configured Python development environment using py-uv-genesis, complete with linting, formatting, and dependency management.
Contributions to improve py-uv-genesis are welcome! Please feel free to submit pull requests or open issues to suggest improvements or report bugs. Let's make this tool even better together! 💪
py-uv-genesis is open-source software licensed under the GNU General Public License (GPL). This means you are free to use, modify, and distribute this software, but any derivative work must also be distributed under the same license terms.
For the full license text, please see the LICENSE file in the repository. Below is a brief summary of the GPL:
Please note that this summary is not a substitute for the full license text. Make sure to read and understand the full GPL license before using or contributing to this project.
Happy coding! 🎉 If you find py-uv-genesis useful, don't forget to give it a star on Gitlab! ⭐
Content type
Image
Digest
sha256:4a108bfec…
Size
170.9 MB
Last updated
2 days ago
docker pull pytgaen/py-uv-genesis:3.10-dev