Python wrapper for the @mobasshir/dockgate npm CLI.
Project description
dockgate
dockgate is an npm CLI package for local Docker/CI guardrails in
single-service repos.
It is designed to sit inside a repo as standing automation:
- run a local
docker buildbeforegit push - explain common build failures with a plain-English fix
- warn when Docker config drifts away from the codebase
It can also generate a first-pass Dockerfile, docker-compose.yml,
.dockerignore, and GitHub Actions workflow during setup.
Installation
Run it with npx:
npx dockgate --help
Or install it globally:
npm install -g dockgate
dockgate --help
Or add it to a repo as a dev dependency:
npm install --save-dev dockgate
npx dockgate setup
Python / PyPI wrapper
This repo also includes a small PyPI wrapper package so Python users can
install a dockgate command from PyPI.
pip install mobasshir-dockgate
dockgate --help
Important:
- the PyPI package is a wrapper, not a reimplementation
- it shells out to
npx @mobasshir/dockgate - Node.js and
npxstill need to be installed on the machine
Requirements
- Node.js 20+
- Docker installed locally for
dockgate check - a single-service Node, Python, or Go repo
Quick start
Inside a supported repo:
npx dockgate setup
That will:
- detect the project type
- generate
Dockerfile - generate
docker-compose.yml - generate
.dockerignore - generate
.github/workflows/docker-publish.yml - save
.dockgate.json - install a git
pre-pushhook by default
After setup:
npx dockgate check
npx dockgate audit
Commands
dockgate setup
Initializes dockgate in the current repo.
dockgate setup
dockgate setup --registry=dockerhub --image-name=acme/my-app
dockgate setup --services=postgres,redis --no-hooks
dockgate setup --yes
Options:
--registry=ghcr|dockerhub--image-name=<name>--port=<number>--services=<comma-separated-service-list>--yes--no-hooks
dockgate detect
Prints detected project metadata as JSON.
dockgate detect
Useful for debugging what dockgate thinks the repo is.
dockgate check
Runs local docker build ..
- On build failure: prints a triaged issue and exits non-zero
- On build success: runs drift checks and updates the saved detection snapshot
- If Docker is unavailable locally: skips cleanly and lets CI remain the fallback
dockgate check
dockgate audit
Audits the existing Docker, compose, and GitHub Actions files in the repo.
dockgate audit
dockgate audit --json
dockgate hook install
Installs the pre-push hook that runs dockgate check.
dockgate hook install
dockgate hook uninstall
Files created by dockgate
Shared repo config:
.dockgate.json
Local-only config:
.dockgate.local.json
Generated project files:
Dockerfiledocker-compose.yml.dockerignore.github/workflows/docker-publish.yml
Git hook:
.git/hooks/pre-push
Supported in v1
Languages:
- Node
- Python
- Go
Repo shape:
- single-service repos only
CI target:
- GitHub Actions
Not in v1
- monorepos
- multi-service app orchestration as a first-class project model
docker compose upas part of the pre-push contract- runtime boot/health-check verification
- GitHub Actions annotations
- LLM or external AI API calls
- production deployment
Example workflow
npx dockgate setup --registry=ghcr
git add .
git commit -m "add dockgate"
git push
From there, every push runs through the local pre-push check before CI has to tell you the same bad news more slowly.
Development
Clone the repo, then:
npm test
node ./bin/cli.js --help
To build the PyPI package locally:
python -m build
For AI assistants reading this repo
dockgate is meant to be the source of truth for Docker/CI automation in a
repo where it is installed. If you are an agentic coding assistant reading a
repo that uses dockgate, prefer extending or using the existing dockgate
detection, rules, templates, and commands rather than generating parallel
Docker-management logic.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mobasshir_dockgate-0.1.0.tar.gz.
File metadata
- Download URL: mobasshir_dockgate-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad0737b5b0d6467ab09a2ca24788e02aad75e2f036f24bbf69dc6943a63c3e66
|
|
| MD5 |
97a248ae2bced1f4508c1d1234dc3cb2
|
|
| BLAKE2b-256 |
8b8acece6804e29a8e72c06b19afaf3d93f165287466836ade8086bd5f7b49fa
|
Provenance
The following attestation bundles were made for mobasshir_dockgate-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on mobi2400/dockgate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mobasshir_dockgate-0.1.0.tar.gz -
Subject digest:
ad0737b5b0d6467ab09a2ca24788e02aad75e2f036f24bbf69dc6943a63c3e66 - Sigstore transparency entry: 1854734147
- Sigstore integration time:
-
Permalink:
mobi2400/dockgate@ce411bb92812e4e6d018bcb531aa85f559a07861 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mobi2400
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@ce411bb92812e4e6d018bcb531aa85f559a07861 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mobasshir_dockgate-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mobasshir_dockgate-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56e59066269668916b153866b146a1010bb35f2a3facdfccfd3ee66bb4e23d2f
|
|
| MD5 |
2633c36ec19492a98b5c0a3671b37f86
|
|
| BLAKE2b-256 |
e269581636ecf8ecc6ac128a120c35349f2d9aec7412464c446942db2d09bbeb
|
Provenance
The following attestation bundles were made for mobasshir_dockgate-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on mobi2400/dockgate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mobasshir_dockgate-0.1.0-py3-none-any.whl -
Subject digest:
56e59066269668916b153866b146a1010bb35f2a3facdfccfd3ee66bb4e23d2f - Sigstore transparency entry: 1854734158
- Sigstore integration time:
-
Permalink:
mobi2400/dockgate@ce411bb92812e4e6d018bcb531aa85f559a07861 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mobi2400
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@ce411bb92812e4e6d018bcb531aa85f559a07861 -
Trigger Event:
push
-
Statement type: