Webtool 4.2 has been converted to use Laravel Sail - Laravel's official Docker development environment. This provides a consistent, containerized development setup with PHP 8.4, MariaDB, Redis, and more.
- Custom Dockerfile with Caddy web server
- Manual Docker Compose configuration
- Services: Caddy, PHP, Reverb, Queue, Redis
- Standard Laravel Sail with PHP 8.4
- Built-in nginx/Apache via Sail
- Services: Laravel App, Redis, Reverb, Queue Worker
- MariaDB runs externally (not in Docker)
- Neo4J runs externally (not in Docker)
| Service | Port | Description |
|---|---|---|
| laravel.test | 80 | Main Laravel application (nginx/Apache) |
| redis | 6379 | Redis cache/session store |
| reverb | 8080 | Laravel Reverb WebSocket server |
| queue | - | Background queue worker |
External Services (Not in Docker):
- MariaDB - Your existing database server
- Neo4J - Graph database (if enabled)
- Docker and Docker Compose installed
- Git
- Node.js/npm/yarn (for Vite, runs on host machine)
IMPORTANT: Update your .env file with these Sail-specific settings:
# Application
APP_PORT=80
# Laravel Sail
WWWUSER=1000
WWWGROUP=1000
SAIL_XDEBUG_MODE=off
# Database (External MariaDB - not in Docker)
# Use host.docker.internal to access host machine from Docker
DB_HOST=host.docker.internal
DB_DATABASE=your_database_name
DB_USERNAME=your_username
DB_PASSWORD=your_password
# Port Forwarding
FORWARD_REDIS_PORT=6379
# Reverb
REVERB_APP_ID=webtool
REVERB_APP_KEY=app-key
REVERB_APP_SECRET=app-secret
REVERB_HOST=localhost
REVERB_PORT=8080
# Neo4J (External - not in Docker)
NEO4J_HOST=localhost
NEO4J_ENABLED=falseFirst time only - build the Docker images:
./vendor/bin/sail build --no-cache./vendor/bin/sail up -dThe -d flag runs containers in the background (detached mode).
./vendor/bin/sail artisan migrateAdd this to your ~/.bashrc or ~/.zshrc:
alias sail='sh $([ -f sail ] && echo sail || echo vendor/bin/sail)'After adding, reload your shell:
source ~/.bashrc # or source ~/.zshrcNow you can use sail instead of ./vendor/bin/sail:
sail up -d
sail artisan migrate
sail composer install| Task | Command |
|---|---|
| Start services | sail up -d |
| Stop services | sail down |
| View logs | sail logs or sail logs -f (follow) |
| Access shell | sail shell or sail root-shell |
| Run Artisan | sail artisan [command] |
| Run Composer | sail composer [command] |
| Run Tests | sail test or sail artisan test |
| Run Tinker | sail tinker |
| Database CLI | sail mariadb |
| Restart services | sail restart |
Vite runs outside Docker on your host machine:
# Terminal 1 - Sail containers
sail up
# Terminal 2 - Vite dev server (host machine)
yarn dev
# or
npm run devVite will be accessible at: http://localhost:5173
- Application: http://localhost
- Reverb WebSockets: ws://localhost:8080
- Redis: localhost:6379
- Database: Your external MariaDB server (configured in .env)
The queue worker runs automatically as a service. To monitor it:
sail logs queue -fReverb runs automatically as a service:
sail logs reverb -fIf ports are already in use, update your .env:
APP_PORT=8000
FORWARD_DB_PORT=33060
FORWARD_REDIS_PORT=63790If you encounter permission errors:
# Set correct user/group IDs
echo "WWWUSER=$(id -u)" >> .env
echo "WWWGROUP=$(id -g)" >> .env
# Rebuild containers
sail down
sail build --no-cache
sail up -dSince you're using an external database (not in Docker), ensure your .env has:
DB_HOST=host.docker.internal # Allows Docker to access host machineThis special hostname host.docker.internal allows containers to connect to services running on your host machine.
Note: Inside Docker containers:
- Use
host.docker.internalto access services on your host machine (like your MariaDB) - Use service names (like
redis) to communicate with other Docker services
# Stop and remove all containers, networks, and volumes
sail down -v
# Rebuild from scratch
sail build --no-cache
# Start fresh
sail up -d
# Run migrations
sail artisan migratedocker ps
# or
sail psNeo4J runs externally (not in Docker). Configure in .env:
NEO4J_HOST=localhost # or your external Neo4J host
NEO4J_PORT=7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your_password
NEO4J_ENABLED=true # Set to true when ready to useTo enable Xdebug for debugging:
- Update
.env:
SAIL_XDEBUG_MODE=develop,debug- Restart Sail:
sail down
sail up -d- Configure your IDE to listen on port 9003
To add more Docker services (Mailpit, Meilisearch, etc.):
sail artisan sail:addThis will prompt you to select additional services.
Note: The current setup intentionally excludes database services since you're using an external MariaDB instance.
Laravel Sail is for local development only. Do not use Sail in production. For production deployment, use proper Docker setups or hosting platforms like Laravel Forge, Laravel Vapor, or custom server configurations.
Your old Docker configuration has been backed up to:
docker-compose.old.yml
If you encounter issues not covered here, check:
- Docker logs:
sail logs - Laravel logs:
storage/logs/laravel.log - Laravel Sail GitHub: https://github.com/laravel/sail