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.23.tar.gz (13.8 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.23-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deployfilegen-0.1.23.tar.gz
  • Upload date:
  • Size: 13.8 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.23.tar.gz
Algorithm Hash digest
SHA256 408b3b2ba0a4227e8760bb1c423a019fe1b00458c307194947ccab474d921a7b
MD5 c557c8ed30b24b765fd166c5120cab2d
BLAKE2b-256 29dc7d3bad264d7ef898d97cb9c5f4457dc88cf4e41077849524ca2ec3dbdf64

See more details on using hashes here.

File details

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

File metadata

  • Download URL: deployfilegen-0.1.23-py3-none-any.whl
  • Upload date:
  • Size: 15.4 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.23-py3-none-any.whl
Algorithm Hash digest
SHA256 5f1895d3e6446224ba62822a75d879ff3eb5fab4b8994a402d5fd9e7a27d410a
MD5 8dd29c0c3e06cd1abed847181bb92eb7
BLAKE2b-256 a35d9cf908c594a7fbaa5d3b2a7cfe01d70f458b7755529621bd6083621dfa1a

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