Files
site-builder/DOCKER.md
Josh Knapp a71b58c2c7 Initial commit: Site Builder with PHP API backend
Visual drag-and-drop website builder using GrapesJS with:
- Multi-page editor with live preview
- File-based asset storage via PHP API (no localStorage base64)
- Template library, Docker support, and Playwright test suite

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 19:25:42 +00:00

1.8 KiB

Site Builder - Docker Container

Quick Start

Start the container:

cd /home/jknapp/code/site-builder
docker-compose up -d

Or use the management script:

./docker-manage.sh start

Access the site builder:

Benefits

  • Auto-restarts - Container restarts automatically if it crashes
  • Survives reboots - Container auto-starts on system boot (unless stopped manually)
  • Live updates - Files are mounted, changes reflect immediately (no rebuild needed)
  • Stable - nginx is rock-solid, won't crash like Python server

Management

Using docker-manage.sh script:

./docker-manage.sh start     # Start the container
./docker-manage.sh stop      # Stop the container
./docker-manage.sh restart   # Restart the container
./docker-manage.sh logs      # View logs (Ctrl+C to exit)
./docker-manage.sh status    # Check if running

Using docker-compose directly:

docker-compose up -d         # Start in background
docker-compose down          # Stop and remove
docker-compose restart       # Restart
docker-compose logs -f       # View logs
docker-compose ps            # Check status

Technical Details

  • Image: nginx:alpine (lightweight, ~40MB)
  • Port: 8081 (host) → 80 (container)
  • Volume: Current directory mounted read-only to /usr/share/nginx/html
  • Restart policy: unless-stopped (auto-restarts on crash, survives reboots)

Troubleshooting

Container not starting?

docker-compose logs

Port already in use?

sudo lsof -i :8081  # See what's using the port
# Or change port in docker-compose.yml

Rebuild if needed:

docker-compose down
docker-compose up -d --force-recreate