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 production-ready deployment configuration files for full-stack applications (Django + React).

Writing Dockerfiles, Compose configs, and CI pipelines repeatedly is slow and error-prone. deployfilegen automates this process using secure, battle-tested defaults.

Quick Start

# 1. Install the tool
pip install deployfilegen

# 2. Initialize your project
deployfilegen init

# 3. Deploy locally
docker compose -f docker-compose.prod.yml up --build

Why deployfilegen?

Standardizing deployment is hard. This tool ensures your project follows industry best practices out of the box:

  • Security: All containers run as non-root users.
  • Reliability: Automated healthchecks and dependency waiting.
  • CI/CD: Complete GitHub Actions workflow with Docker layer caching.
  • Zero Hardcoding: All configuration is derived from your .env files.

Example Project Structure

The tool expects a standard full-stack layout:

my-cool-project/
├── backend/            # Django project
│   └── manage.py
├── frontend/           # React project
│   └── package.json
└── .env                # Required environment variables

CLI Output Example

$ deployfilegen init
INFO: Initializing deployfilegen in /path/to/project (Mode: prod)
INFO: Detected Django backend.
INFO: Detected React frontend.
INFO: Loaded environment from: .env
INFO: Generating Backend Dockerfile...
INFO: Generated backend/Dockerfile
INFO: Generating Frontend Dockerfile...
INFO: Generated frontend/Dockerfile
INFO: Generating Docker Compose...
INFO: Generated docker-compose.prod.yml
INFO: Generating GitHub Actions workflow...
INFO: Generated .github/workflows/deploy.yml
INFO: Deployment configuration generated successfully!

Usage

Navigate to your project root and run:

# Generate a boilerplate .env template
deployfilegen template

# Initialize your project
deployfilegen init [OPTIONS]

Commands

  • init: Initialize deployment configuration.
  • template: Generate a boilerplate .env file.

Global Options

  • --version, -v: Show the version and exit.
  • --help: Show this message and exit.

init Command Options

Option Description
--mode prod Generates docker-compose.prod.yml (Default). Optimized for servers.
--mode dev Generates docker-compose.dev.yml. Optimized for local coding.
--force, -f Overwrite existing files. (Default: skips existing files).
--docker-only Generate only the Dockerfiles.
--compose-only Generate only the Docker Compose files.
--github-only Generate only the GitHub Actions workflow.
--backend-only Filter generation to only Backend components.
--frontend-only Filter generation to only Frontend components.

Requirements

  • Python 3.9+
  • A project structure with a Django-based backend and a React-based frontend.
  • A .env file containing: DOCKER_USERNAME, BACKEND_IMAGE_NAME, FRONTEND_IMAGE_NAME, DEPLOY_HOST, and DEPLOY_USER.

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.22.tar.gz (13.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.22-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deployfilegen-0.1.22.tar.gz
  • Upload date:
  • Size: 13.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.22.tar.gz
Algorithm Hash digest
SHA256 2982628c43461bf04194cda4d88f22901e2d27334e3b73caf2da91997760138d
MD5 3e89ce1f33be5ea7078f0c3006b5cd75
BLAKE2b-256 37c4cc71f6b5715f0575c790305e5a1f2ce6618c77bcfca8ac936f5b47d772c0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: deployfilegen-0.1.22-py3-none-any.whl
  • Upload date:
  • Size: 15.3 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.22-py3-none-any.whl
Algorithm Hash digest
SHA256 f135fe61ee72f8e612b016006b7e12268c4051afe0b277e47ec29abf0dd59be3
MD5 e0cee88df195adfadb8df8eb85cbe096
BLAKE2b-256 6d351f99c7c3b1dda5b16ab62f31873c54616e2d0ae4c499c55e2b47abec5bb8

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