Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeployBox — Single-Command Docker Runner

A lightweight Go CLI that auto-detects any project's stack and generates a production-ready Dockerfile from it — then builds and runs the container with one command. No Docker knowledge required.

Tech Stack

Go 1.23 Docker YAML

How It Works

deploybox init <dir>
    │
    ├─ Scans for build files (pom.xml, requirements.txt, package.json, ...)
    ├─ Auto-detects language → Java, Python, Node, Rust, Go
    ├─ Reads deploy.yaml (optional) → overrides name, port, env, volumes, command
    ├─ Generates multi-stage Dockerfile with layer caching
    └─ Writes Dockerfile (and docker-compose.yml if depends_on is set)

deploybox up <dir>
    │
    ├─ Same pipeline as init (auto-generates if no Dockerfile exists)
    ├─ docker build -t deploybox-<name>
    ├─ docker run -d --rm (or docker compose up -d for multi-service)
    └─ Container running

deploybox down <dir>
    └─ docker compose down or docker stop (idempotent)

deploybox logs <dir> [-f]
    └─ docker logs [-f] <container>

Detection Rules

Build file found Language Docker base image
pom.xml Java 21 + Maven eclipse-temurin:21-jre-alpine (multi-stage)
requirements.txt Python 3.12 + pip python:3.12-slim
package.json Node.js + npm node:22-alpine
Cargo.toml Rust + Cargo debian:bookworm-slim (multi-stage)
go.mod Go modules scratch (multi-stage, static binary)

deploy.yaml (optional overrides)

name: ocrtranslate
command: python run.py images --batch
port: 5000
env:
  OLLAMA_HOST: http://host.docker.internal:11434
volumes:
  - ./images:/app/images
  - ./outputs:/app/outputs
depends_on:
  - ollama

If depends_on is set, DeployBox generates a docker-compose.yml wiring services together instead of a bare docker run.

Building & Running

Requires Go 1.23+ and Docker.

go build -o deploybox .
./deploybox init              # generate Dockerfile for current directory
./deploybox up                # build + start
./deploybox logs -f           # tail container output
./deploybox down              # stop + clean up

Key Design Decisions

Zero-config detection

The tool scans for a single known filename per stack and generates the Dockerfile immediately. No wizard, no prompts, no config required. If you have pom.xml or requirements.txt, you have a Dockerfile.

Multi-stage builds with layer caching

Every generated Dockerfile uses Docker's layer caching — dependencies are copied and installed before source code, so rebuilds after code changes skip the entire dependency resolution step.

host.docker.internal for local services

Containers can reach services running on the host machine (Ollama, databases, etc.) through Docker Desktop's built-in DNS name — no network gymnastics.

Cross-project Dockerfile consistency

All generated Dockerfiles follow the same conventions: slim base images, single WORKDIR /app, non-root users where possible. If you use DeployBox on three different projects, you get three structurally identical Dockerfiles — audit once, trust all.

Verified Against

  • OCR Translate (Python) — detected requirements.txt, built image, ran python run.py images --batch, connected to Windows Ollama via host.docker.internal, produced translated output
  • MouseFlow Tracker (Java/Maven) — detected pom.xml, built multi-stage image, resolved JNA + JavaFX + JNativeHook dependencies, compiled 4 source files, produced JAR

About

Testing Projects with Docker

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages