Sign inSign up

trydirect/stacker

By trydirect

Updated about 1 hour ago

Backend API for custom stack builder. Builds docker-compose.

Image
Integration & delivery
Internet of things
Developer tools
1

10K+

trydirect/stacker repository overview

Stacker — Build, Deploy & Manage Containerised Apps

Discord Version License GitHub

Stacker is an open-source platform that turns any project into a deployable Docker stack using a single stacker.yml config file. It auto-generates Dockerfiles, docker-compose definitions, reverse-proxy configs, and deploys locally or to cloud providers — optionally with AI assistance.


Architecture

┌──────────────┐         ┌──────────────────┐         ┌─────────────────────┐
│  Stacker CLI │────────▶│  Stacker Server  │────────▶│  Status Panel Agent │
│              │  REST   │                  │  queue  │  (on target server) │
│  stacker.yml │  API    │  Stack Builder UI│  pull   │                     │
│  init/deploy │         │  48+ MCP tools   │◀────────│  health / logs /    │
│  status/logs │         │  Vault · AMQP    │  HMAC   │  restart / exec /   │
└──────────────┘         └──────────────────┘         │  deploy_app / proxy │
                                │                     └─────────────────────┘
                                ▼
                    Terraform + Ansible ──▶ Cloud
                    (Hetzner, DO, AWS, Linode)
ComponentDescription
Stacker CLIDeveloper tool — init, deploy, monitor from the terminal
Stacker ServerREST API + Stack Builder UI + deployment orchestration + MCP Server (this image)
Status Panel AgentDeployed on the target server — executes commands, streams logs, reports health

Quick Start

Run the Stacker Server
docker pull trydirect/stacker:latest

docker run -d \
  --name stacker \
  -p 8000:8000 \
  -e DATABASE_URL=postgres://postgres:postgres@db:5432/stacker \
  -e RUST_LOG=info \
  trydirect/stacker:latest
version: "3.8"

services:
  stacker:
    image: trydirect/stacker:latest
    container_name: stacker
    restart: always
    ports:
      - "8000:8000"
    volumes:
      - ./files:/app/files
      - ./configuration.yaml:/app/configuration.yaml
      - ./access_control.conf:/app/access_control.conf
      - ./migrations:/app/migrations
    environment:
      - RUST_LOG=info
    depends_on:
      db:
        condition: service_healthy

  db:
    image: postgres:16
    restart: always
    environment:
      POSTGRES_DB: stacker
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    volumes:
      - stackerdb:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7
    restart: always

  rabbitmq:
    image: rabbitmq:3-management
    restart: always

volumes:
  stackerdb:
Install the CLI
curl -fsSL https://raw.githubusercontent.com/trydirect/stacker/main/install.sh | bash
cd my-project
stacker init              # auto-detects project type, generates stacker.yml
stacker deploy            # builds and runs locally via docker compose
stacker status            # check running containers

What's Inside This Image

The trydirect/stacker image contains the Stacker Server — a Rust-built backend that provides:

REST API & Stack Builder UI
  • Create, update, and manage deployment projects
  • Full CRUD for apps, services, environment variables, port mappings, and domains
  • Role-based access control (Casbin)
MCP Server (Model Context Protocol)

48+ tools exposed over WebSocket, enabling AI agents (Claude, GPT, etc.) to manage infrastructure programmatically:

  • Project & deployment management
  • Container operations (start, stop, restart, exec)
  • Log analysis & error summaries
  • Vault config read/write
  • Proxy configuration
  • Server resource monitoring
  • Docker Compose generation & preview
Deployment Orchestration
  • Localdocker compose up on the host machine
  • Cloud — Terraform + Ansible for Hetzner, DigitalOcean, AWS, Linode
  • Server — deploy to any existing server via SSH
Integrations
  • HashiCorp Vault — secrets and config storage, synced to deployments
  • RabbitMQ (AMQP) — event-driven deployment status updates
  • PostgreSQL — persistent storage for projects, deployments, and config
  • Redis — caching layer for DockerHub metadata and sessions
  • TryDirect User Service — OAuth, marketplace templates

Stacker CLI Highlights

The CLI (stacker-cli) is a standalone binary — no server required for local deploys:

CommandDescription
stacker initDetect project type, generate stacker.yml + Dockerfile + Compose
stacker deployBuild & deploy the stack (local, cloud, or server)
stacker statusShow running containers and health
stacker logsView container logs (--follow, --service, --tail)
stacker destroyTear down the deployed stack
stacker ai askAsk AI about your stack, or let it modify config
stacker service addAdd from 20+ built-in service templates
stacker ssh-key generateGenerate Vault-backed SSH keys
AI-Powered Init
stacker init --with-ai                          # Local AI (Ollama, free & private)
stacker init --with-ai --ai-provider openai     # OpenAI
stacker init --with-ai --ai-provider anthropic  # Anthropic

Scans your project files, detects the stack type, and uses an LLM to generate a tailored stacker.yml with services, proxy, monitoring, and hooks.

Service Catalog (20+ templates)
stacker service list
stacker service add postgres redis nginx

Built-in templates: postgres, mysql, mongodb, redis, memcached, rabbitmq, traefik, nginx, nginx_proxy_manager, wordpress, elasticsearch, kibana, qdrant, telegraf, phpmyadmin, mailhog, minio, portainer, and more.


stacker.yml Example

name: my-app
app:
  type: node
  path: ./src
  ports:
    - "8080:3000"
  environment:
    NODE_ENV: production

services:
  - name: postgres
    image: postgres:16
    environment:
      POSTGRES_DB: myapp
      POSTGRES_PASSWORD: ${DB_PASSWORD}

proxy:
  type: nginx
  auto_detect: true
  domains:
    - domain: app.example.com
      ssl: auto
      upstream: app:3000

deploy:
  target: local

ai:
  enabled: true
  provider: ollama
  model: llama3

monitoring:
  status_panel: true
  healthcheck:
    endpoint: /health
    interval: 30s

Supported Project Types

Stacker auto-detects and generates optimised multi-stage Dockerfiles for:

TypeDetection
Node.jspackage.json
Pythonrequirements.txt, pyproject.toml, Pipfile
RustCargo.toml
Gogo.mod
PHPcomposer.json
Staticindex.html, or manual type: static

Environment Variables

VariableDescriptionDefault
DATABASE_URLPostgreSQL connection string
RUST_LOGLog level (error, warn, info, debug, trace)info
APP_HOSTListen address0.0.0.0
APP_PORTListen port8000
VAULT_ADDRESSHashiCorp Vault URLhttp://127.0.0.1:8200
VAULT_TOKENVault authentication token
AMQP_HOSTRabbitMQ host127.0.0.1
AMQP_PORTRabbitMQ port5672

Exposed Ports

PortService
8000Stacker Server API

Volumes

PathPurpose
/app/filesGenerated stack files (Dockerfiles, Compose, configs)
/app/configuration.yamlServer configuration
/app/access_control.confCasbin RBAC policy
/app/migrationsSQL migration files

Tags

TagDescription
latestLatest stable release
x.y.zSpecific version (e.g. 0.2.4)
testDevelopment/testing builds


License

MIT — see LICENSE for details.

Tag summary

Content type

Image

Digest

sha256:c20db2589

Size

95.5 MB

Last updated

about 1 hour ago

docker pull trydirect/stacker