# 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