Skip to main content

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.28+)

  • Zero-Config Dev Mode: Works with any existing .env file. No forced variable naming.
  • Smart Framework Detection: Automatically detects Vite (port 5173), Next.js (port 3000), or Create React App.
  • Production-Grade Defaults:
    • Security: Non-root users, unprivileged Nginx.
    • Reliability: Healthchecks, depends_on, and race-condition prevention.
    • Optimization: Multi-stage builds, .dockerignore generation, layer caching.
  • Environment Agnostic: Reads defaults from your .env (root, backend/, or frontend/).

📦 Quick Start

1. Install

pip install deployfilegen

2. Local Development (Zero Config)

Just run this in your project root. It detects your setup and generates a working local dev environment.

deployfilegen init --mode dev

Then start your app:

docker compose -f docker-compose.dev.yml up --build

What you get:

  • backend/Dockerfile (Hot-reload enabled)
  • frontend/Dockerfile (Hot-reload enabled, correct port detected)
  • docker-compose.dev.yml (Binds to your local .env)

3. Production Deployment

generate hardened artifacts for deployment.

deployfilegen init --mode prod

What you get:

  • backend/Dockerfile (Optimized, Gunicorn, Static files)
  • frontend/Dockerfile (Nginx, Multi-stage build)
  • docker-compose.prod.yml (Restart policies, Healthchecks)
  • .github/workflows/deploy.yml (CI/CD pipeline)

🛠 Supported Stacks

Backend:

  • Django: Auto-detects project name from manage.py.
  • Python: Uses 3.11-slim by default.

Frontend:

  • Vite: Auto-configures port 5173 and host binding.
  • Next.js: Auto-configures port 3000 and standalone build.
  • Create React App: Auto-configures port 3000.

⚙️ Configuration

.env File

For Dev Mode, you just need a .env file. The tool respects whatever variables you have.

For Production Mode, you need these variables to generate the CI/CD workflow:

# Container Registry
DOCKER_USERNAME=your_username
BACKEND_IMAGE_NAME=your_repo/backend
FRONTEND_IMAGE_NAME=your_repo/frontend

# Deployment Server (SSH)
DEPLOY_HOST=1.2.3.4
DEPLOY_USER=ubuntu

You can generate a template with:

deployfilegen template

📖 CLI Reference

Usage: deployfilegen init [OPTIONS]

Options:
  --mode [dev|prod]    Generation mode (Default: prod)
  --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
  --help               Show this message

📄 License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deployfilegen-0.1.29.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deployfilegen-0.1.29-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file deployfilegen-0.1.29.tar.gz.

File metadata

  • Download URL: deployfilegen-0.1.29.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for deployfilegen-0.1.29.tar.gz
Algorithm Hash digest
SHA256 e408f5a8dc5b376740247029be319a51bf984d2cf7efddde58116e8dd7141458
MD5 4d4dc86b03d70efbd6caf5d0cccaff01
BLAKE2b-256 3f13bdc5bf4f22028073621a27bb74261144ed8df67eea8112ac09adf37571c4

See more details on using hashes here.

File details

Details for the file deployfilegen-0.1.29-py3-none-any.whl.

File metadata

  • Download URL: deployfilegen-0.1.29-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for deployfilegen-0.1.29-py3-none-any.whl
Algorithm Hash digest
SHA256 52bd069f7d45e78f5d90b6d25a7df0e6f59cb3e5fb618f2cc01ddd3c1c27e666
MD5 9ff170b878c19d1fbb63f15534f99da3
BLAKE2b-256 5dced55ff579b7d151a71e9baa98784ccbb08ad1a8653e82f5fd273a7e62cbac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page