How-To Guide
Docker Local Deployment
Get your installation running locally with hot reload for development.
Meta-awareness
This is the service manual for the website you're reading right now. Every page, every component, every deployment step documented here—it's all running the code described in these guides. The documentation documents itself.
Prerequisites
Before deploying locally, ensure you have:
- Docker Desktop installed and running (version 20.10+)
- Git for cloning the repository
- Caddy network created (
docker network create caddy) - Text editor for configuration (VS Code, vim, etc.)
Check Docker version:
docker --version
# Expected: Docker version 20.10.0 or higher
docker compose version
# Expected: Docker Compose version v2.0.0 or higher Step 1: Clone the repository
Clone your installation repository to your local machine:
# Clone the repository
git clone https://github.com/your-org/your-installation.git
# Navigate into the directory
cd your-installation/website Note: The website/ subdirectory contains the Astro application and Docker configuration.
Step 2: Configure environment
Create a .env file with development settings:
# Development mode settings
ATELIER_MODE=dev
NODE_ENV=development
# Enable hot reload
ENABLE_HMR=true
# Ambient effects (optional)
AMBIENT_EFFECTS_ENABLED=true
AMBIENT_INTENSITY=medium
# Docker configuration
COMPOSE_PROJECT_NAME=your-installation-dev
PUBLIC_DOMAIN=localhost
# Debug settings
DEBUG=true
LOG_LEVEL=info Key environment variables:
ATELIER_MODE=dev- Enables development featuresENABLE_HMR=true- Hot module reload for code changesCOMPOSE_PROJECT_NAME- Prevents Docker name conflictsDEBUG=true- Shows detailed error messages
Step 3: Start services
Use the provided atelier.sh script or Docker Compose directly:
Option A: Using atelier.sh (recommended)
# Start in development mode
./atelier.sh dev
# This runs:
# docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build Option B: Direct Docker Compose
# Start with both base and development overrides
docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build
# Start in detached mode (runs in background)
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build First run: Expect 2-5 minutes for initial build. Subsequent starts are faster (~30 seconds).
Step 4: Verify deployment
Check that services are running and accessible:
1. Check container status
docker compose ps
# Expected output:
# NAME STATUS
# your-installation-web Up (healthy) 2. Access the installation
# Open in browser
open http://localhost:4321
# Or with curl
curl -I http://localhost:4321
# Expected: HTTP/1.1 200 OK 3. Check logs for errors
# View logs (follow mode)
docker compose logs -f
# View only web service logs
docker compose logs -f web
# Exit logs: Ctrl+C Success indicators:
- Container shows
Up (healthy)status - Site loads at
http://localhost:4321 - Logs show
[astro] Ready in X ms - Hot reload works (edit a file, see changes)
Step 5: Test hot reload
Verify hot module reload is working:
- 1. Open
src/pages/index.astroin your editor - 2. Change the heading text
- 3. Save the file
- 4. Watch browser auto-refresh (2-3 seconds)
Not working? Check that ENABLE_HMR=true in .env and restart containers.
Managing the deployment
Common operations for local development:
Stop services
# Stop containers (keeps them)
docker compose stop
# Stop and remove containers
docker compose down
# Stop, remove, and clean volumes
docker compose down -v Restart services
# Restart without rebuild
docker compose restart
# Restart with rebuild (after dependency changes)
docker compose up --build -d View logs
# All services, follow mode
./atelier.sh logs
# Specific service
docker compose logs -f web
# Last 100 lines
docker compose logs --tail=100 Clean rebuild
# Stop, clean, and rebuild from scratch
./atelier.sh clean
./atelier.sh dev
# Or manually:
docker compose down -v
docker compose build --no-cache
docker compose up -d Common issues
Port 4321 already in use
Another process is using the port. Find and stop it:
# Find process using port 4321
lsof -i :4321
# Kill the process (use PID from above)
kill -9 <PID>
# Or change port in docker-compose.dev.yml Caddy network not found
The external caddy network doesn't exist. Create it:
docker network create caddy Changes not reflecting
Hot reload might not be working. Check:
- •
ENABLE_HMR=truein.env - • Volume mounts correct in
docker-compose.dev.yml - • File saved (check editor auto-save settings)
- • Browser cache cleared (Ctrl+Shift+R / Cmd+Shift+R)
Build fails with dependency errors
Package versions might be incompatible. Clean and rebuild:
# Remove node_modules volume
docker compose down -v
# Rebuild without cache
docker compose build --no-cache
# Start fresh
docker compose up -d Next steps
Your local installation is running. Now you can: