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>
This commit is contained in:
71
DOCKER.md
Normal file
71
DOCKER.md
Normal file
@@ -0,0 +1,71 @@
|
||||
# Site Builder - Docker Container
|
||||
|
||||
## Quick Start
|
||||
|
||||
**Start the container:**
|
||||
```bash
|
||||
cd /home/jknapp/code/site-builder
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
**Or use the management script:**
|
||||
```bash
|
||||
./docker-manage.sh start
|
||||
```
|
||||
|
||||
**Access the site builder:**
|
||||
- From Windows: http://localhost:8081
|
||||
- From WSL: http://localhost:8081
|
||||
|
||||
## 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:**
|
||||
```bash
|
||||
./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:**
|
||||
```bash
|
||||
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?**
|
||||
```bash
|
||||
docker-compose logs
|
||||
```
|
||||
|
||||
**Port already in use?**
|
||||
```bash
|
||||
sudo lsof -i :8081 # See what's using the port
|
||||
# Or change port in docker-compose.yml
|
||||
```
|
||||
|
||||
**Rebuild if needed:**
|
||||
```bash
|
||||
docker-compose down
|
||||
docker-compose up -d --force-recreate
|
||||
```
|
||||
Reference in New Issue
Block a user