A production-grade CLI tool to generate deployment configuration files for Django/React projects.
Project description
deployfilegen
deployfilegen is a production-grade Python CLI library designed to automatically generate infrastructure-as-code for full-stack applications (Django + React/Next.js/Vite).
It automates the creation of Dockerfiles, docker-compose.yml, and GitHub Actions workflows, using secure, battle-tested defaults.
🚀 Key Features (v0.1.31+)
- Zero-Config Dev Mode: Works with any existing
.envfile. No forced variable naming. - Smart Framework Detection: Automatically detects Vite (port 5173), Next.js (port 3000), or Create React App.
- Flexible Deployment: Choose between SSH Build (default) or Registry Push strategies.
- Production-Grade Defaults:
- Security: Non-root users, unprivileged Nginx.
- Reliability: Healthchecks,
depends_on, and race-condition prevention. - Optimization: Multi-stage builds,
.dockerignoregeneration, layer caching.
📦 Quick Start
1. Install
pip install deployfilegen
2. Local Development (Zero Config)
deployfilegen init --mode dev
docker compose -f docker-compose.dev.yml up --build
3. Production — SSH Build (Default)
Build images directly on your server. No container registry needed.
deployfilegen init --mode prod --deploy ssh
Required .env variables:
DEPLOY_HOST=your_server_ip
DEPLOY_USER=ubuntu
GitHub Actions workflow will:
SSH → git pull → docker compose build → docker compose up -d
4. Production — Registry Push
Push images to Docker Hub/GHCR, then pull on server.
deployfilegen init --mode prod --deploy registry
Required .env variables:
DEPLOY_HOST=your_server_ip
DEPLOY_USER=ubuntu
DOCKER_USERNAME=your_username
BACKEND_IMAGE_NAME=user/backend
FRONTEND_IMAGE_NAME=user/frontend
GitHub Actions workflow will:
Build → Push to Registry → SSH → docker compose pull → up -d
🛠 Supported Stacks
Backend:
- Django: Auto-detects project name from
manage.py. - Python: Uses
3.11-slimby default.
Frontend:
- Vite: Auto-configures port
5173and host binding. - Next.js: Auto-configures port
3000and standalone build. - Create React App: Auto-configures port
3000.
⚙️ Configuration
Generate a boilerplate .env:
deployfilegen template # SSH mode (minimal)
deployfilegen template --deploy registry # Registry mode (full)
📖 CLI Reference
Usage: deployfilegen init [OPTIONS]
Options:
--mode [dev|prod] Generation mode (Default: prod)
--deploy [ssh|registry] Deployment strategy (Default: ssh)
--force, -f Overwrite existing files
--with-db Include a Postgres service in docker-compose
--docker-only Generate only Dockerfiles
--compose-only Generate only docker-compose.yml
--github-only Generate only GitHub Actions (Prod only)
--backend-only Only generate backend assets
--frontend-only Only generate frontend assets
# Stability Overrides
--frontend-port Override detected frontend dev port
--start-command Override detected frontend start command
--project-name Override detected Django project name
--help Show this message
📄 License
MIT
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 deployfilegen-0.1.31.tar.gz.
File metadata
- Download URL: deployfilegen-0.1.31.tar.gz
- Upload date:
- Size: 17.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
023c45886ba4d743d9118aad9021717f727867529488bc9df001e3a034a117df
|
|
| MD5 |
b68ba95613cf954b8ed82ff860a2b05f
|
|
| BLAKE2b-256 |
2c8fc09fda42bd46866e7bce2196b16d97a884ba3daec0595b95da0c5e3d7050
|
File details
Details for the file deployfilegen-0.1.31-py3-none-any.whl.
File metadata
- Download URL: deployfilegen-0.1.31-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0af8280e51650ef20a4db9cc831fa19c71c1ca008e6bdbf6734d66250f3aecbd
|
|
| MD5 |
5ffce0cdf1180ffbaaa5c08f4c17ebd5
|
|
| BLAKE2b-256 |
719c8ccfceb602713f10831025428f957d916e53d224563ba9c39abb43d0e082
|