feat: one-click cloud deployment — Caddy HTTPS, Ollama, systemd, cloud-init
Add complete production deployment stack so Timmy can be deployed to any cloud provider (DigitalOcean, AWS, Hetzner, etc.) with a single command. New files: - docker-compose.prod.yml: production stack (Caddy auto-HTTPS, Ollama LLM, Dashboard, Timmy agent, Watchtower auto-updates) - deploy/Caddyfile: reverse proxy with security headers and WebSocket support - deploy/setup.sh: interactive one-click setup script for any Ubuntu/Debian server - deploy/cloud-init.yaml: paste as User Data when creating a cloud VM - deploy/timmy.service: systemd unit for auto-start on boot - deploy/digitalocean/create-droplet.sh: create a DO droplet via doctl CLI Updated: - Dockerfile: non-root user, healthcheck, missing deps (GitPython, moviepy, redis) - Makefile: cloud-deploy, cloud-up/down/logs/status/update/scale targets - .env.example: DOMAIN setting for HTTPS - .dockerignore: exclude deploy configs from image https://claude.ai/code/session_018CduUZoEJzFynBwMsxaP8T
This commit is contained in:
58
Makefile
58
Makefile
@@ -1,5 +1,6 @@
|
||||
.PHONY: install install-bigbrain dev test test-cov test-cov-html watch lint clean help \
|
||||
docker-build docker-up docker-down docker-agent docker-logs docker-shell
|
||||
docker-build docker-up docker-down docker-agent docker-logs docker-shell \
|
||||
cloud-deploy cloud-up cloud-down cloud-logs cloud-status cloud-update
|
||||
|
||||
VENV := .venv
|
||||
PYTHON := $(VENV)/bin/python
|
||||
@@ -95,6 +96,45 @@ docker-logs:
|
||||
docker-shell:
|
||||
docker compose exec dashboard bash
|
||||
|
||||
# ── Cloud Deploy ─────────────────────────────────────────────────────────────
|
||||
|
||||
# One-click production deployment (run on your cloud server)
|
||||
cloud-deploy:
|
||||
@bash deploy/setup.sh
|
||||
|
||||
# Start the production stack (Caddy + Ollama + Dashboard + Timmy)
|
||||
cloud-up:
|
||||
docker compose -f docker-compose.prod.yml up -d
|
||||
|
||||
# Stop the production stack
|
||||
cloud-down:
|
||||
docker compose -f docker-compose.prod.yml down
|
||||
|
||||
# Tail production logs
|
||||
cloud-logs:
|
||||
docker compose -f docker-compose.prod.yml logs -f
|
||||
|
||||
# Show status of all production containers
|
||||
cloud-status:
|
||||
docker compose -f docker-compose.prod.yml ps
|
||||
|
||||
# Pull latest code and rebuild
|
||||
cloud-update:
|
||||
git pull
|
||||
docker compose -f docker-compose.prod.yml up -d --build
|
||||
|
||||
# Create a DigitalOcean droplet (requires doctl CLI)
|
||||
cloud-droplet:
|
||||
@bash deploy/digitalocean/create-droplet.sh
|
||||
|
||||
# Scale agent workers in production: make cloud-scale N=4
|
||||
cloud-scale:
|
||||
docker compose -f docker-compose.prod.yml --profile agents up -d --scale agent=$${N:-2}
|
||||
|
||||
# Pull a model into Ollama: make cloud-pull-model MODEL=llama3.2
|
||||
cloud-pull-model:
|
||||
docker exec timmy-ollama ollama pull $${MODEL:-llama3.2}
|
||||
|
||||
# ── Housekeeping ──────────────────────────────────────────────────────────────
|
||||
|
||||
clean:
|
||||
@@ -105,6 +145,8 @@ clean:
|
||||
|
||||
help:
|
||||
@echo ""
|
||||
@echo " Local Development"
|
||||
@echo " ─────────────────────────────────────────────────"
|
||||
@echo " make install create venv + install dev deps"
|
||||
@echo " make install-bigbrain install with AirLLM (big-model backend)"
|
||||
@echo " make dev start dashboard at http://localhost:8000"
|
||||
@@ -116,6 +158,8 @@ help:
|
||||
@echo " make lint run ruff or flake8"
|
||||
@echo " make clean remove build artefacts and caches"
|
||||
@echo ""
|
||||
@echo " Docker (Dev)"
|
||||
@echo " ─────────────────────────────────────────────────"
|
||||
@echo " make docker-build build the timmy-time:latest image"
|
||||
@echo " make docker-up start dashboard container"
|
||||
@echo " make docker-agent add one agent worker (AGENT_NAME=Echo)"
|
||||
@@ -123,3 +167,15 @@ help:
|
||||
@echo " make docker-logs tail container logs"
|
||||
@echo " make docker-shell open a bash shell in the dashboard container"
|
||||
@echo ""
|
||||
@echo " Cloud Deploy (Production)"
|
||||
@echo " ─────────────────────────────────────────────────"
|
||||
@echo " make cloud-deploy one-click server setup (run as root)"
|
||||
@echo " make cloud-up start production stack"
|
||||
@echo " make cloud-down stop production stack"
|
||||
@echo " make cloud-logs tail production logs"
|
||||
@echo " make cloud-status show container status"
|
||||
@echo " make cloud-update pull + rebuild from git"
|
||||
@echo " make cloud-droplet create DigitalOcean droplet (needs doctl)"
|
||||
@echo " make cloud-scale N=4 scale agent workers"
|
||||
@echo " make cloud-pull-model MODEL=llama3.2 pull LLM model"
|
||||
@echo ""
|
||||
|
||||
Reference in New Issue
Block a user