Skip to main content

Module docker

Module docker 

Source
Expand description

Docker integration for Python projects

Generate Dockerfiles and build images from [tool.rx.docker] config:

[tool.rx.docker]
base-image = "python:3.11-slim"
python-version = "3.11"
entrypoint = ["python", "-m", "myapp"]
cmd = ["--help"]
expose = [8000]
env = { APP_ENV = "production" }
copy = ["src/", "config/"]
workdir = "/app"
user = "appuser"
labels = { maintainer = "dev@example.com" }
apt-packages = ["curl", "gcc"]
build-args = { PIP_NO_CACHE_DIR = "1" }
multi-stage = true

Structs§

DockerConfig
Docker configuration from pyproject.toml
DockerfileGenerator
Dockerfile generator

Functions§

build_image
Build a Docker image