This guide describes how to use Docker and Docker Compose for development with DocGen.
Docker provides:
- Consistent development environment
- Isolation from local system
- Easy to reproduce issues
- Same environment as CI/CD
The project builds multiple Docker images:
Make resolves the reviewed version from app/doc_gen/__version__.py before a
local development or production build and supplies it to setuptools-scm as a
Docker build argument. This is required because .git is intentionally absent
from the Docker build context. You can override the value for a reviewed build,
for example make c-build-prod DOC_GEN_BUILD_VERSION=1.0.2.
| Image | Description |
|---|---|
doc-gen:latest |
Base image |
doc-gen-dev:latest |
Development image |
doc-gen-prod:latest |
Production image |
make d-build-basemake d-build-devmake d-build-prodmake d-build-allmake d-testmake d-generate
make d-generate-smartmake d-print
make d-print-smartmake d-analyzemake c-upmake c-up-detachedmake c-downmake c-logs# Initialize
make c-init
# Generate
make c-generate
# Print
make c-print
# Analyze
make c-analyze# Run formatting
make c-format
# Run linter
make c-lint
# Run tests
make c-test
# Run full check
make c-checkmake c-ciThe Makefile provides convenient shortcuts:
# See all available commands
make helpSee make-workflow.md for grouped local, Docker, Compose,
and published utility image commands.
Stable production releases publish four coordinated references to the same
image: exact v1.0.2, minor v1.0, major v1, and latest. Pin CI and
reproducible automation to the immutable exact tag. The other aliases move only
when a compatible stable release is published. Prereleases such as
v1.0.0-rc.1 publish only their exact tag.
GitHub and GitLab enforce the same alias and prerelease policy. See the CI/CD and release contract for publication safeguards.
Install Docker Desktop from https://www.docker.com/products/docker-desktop
Check Docker is running:
docker infoTry rebuilding:
docker compose build --no-cache