mcnanovna-docs/Makefile
Ryan Malloy e21219be8d Initial docs site: Astro/Starlight with caddy-docker-proxy
- Starlight documentation for mcnanovna and mcpositioner
- 19 pages covering tools, prompts, hardware, and tutorials
- Docker deployment with dev/prod modes
- Makefile for docker compose management
- Custom SVG logos and hero illustration
2026-02-04 13:53:21 -07:00

78 lines
1.9 KiB
Makefile

# mcnanovna docs - Makefile for docker compose management
# Usage:
# make up - Start production (static site)
# make dev - Start development (hot-reload)
# make down - Stop containers
# make logs - Follow container logs
# make build - Rebuild container images
# make shell - Open shell in running container
.PHONY: up down logs build rebuild shell dev clean help
# Load environment variables
include .env
export
# Compose command shortcuts
COMPOSE := docker compose
COMPOSE_DEV := docker compose -f docker-compose.yml -f docker-compose.dev.yml
# Default target
help:
@echo "mcnanovna docs - Astro/Starlight documentation site"
@echo ""
@echo "Usage:"
@echo " make up Start production (static Caddy server)"
@echo " make dev Start development (Vite hot-reload)"
@echo " make down Stop all containers"
@echo " make logs Follow container logs"
@echo " make build Build production image"
@echo " make rebuild Force rebuild (no cache)"
@echo " make shell Open shell in running container"
@echo " make clean Remove containers, images, volumes"
@echo ""
@echo "Environment:"
@echo " DOMAIN = $(DOMAIN)"
@echo " MODE = $(MODE)"
# Production mode
up: .env
$(COMPOSE) up -d
$(COMPOSE) logs -f
# Development mode with hot-reload
dev: .env
$(COMPOSE_DEV) up -d --build
$(COMPOSE_DEV) logs -f
# Stop containers
down:
$(COMPOSE) down
$(COMPOSE_DEV) down 2>/dev/null || true
# View logs
logs:
$(COMPOSE) logs -f
# Build image
build:
$(COMPOSE) build
# Rebuild without cache
rebuild:
$(COMPOSE) build --no-cache
# Shell into running container
shell:
$(COMPOSE) exec docs sh
# Clean everything
clean:
$(COMPOSE) down -v --rmi local
$(COMPOSE_DEV) down -v --rmi local 2>/dev/null || true
# Create .env from example if missing
.env:
@echo "Creating .env from .env.example..."
@cp .env.example .env