a5569ce2a0059332be3acc3c0db8e44c1d2f5bba
AIGO - Docker Deployment
Project Structure
aigo-docker/
├── Dockerfile # 3-stage: composer → npm build → php:8.2-apache
├── docker-compose.yml # 4 services: app, reverb, queue, db
├── docker-entrypoint.sh # Waits for DB, runs migrate/cache/link
├── .env.example # All required env vars
├── .dockerignore
├── docker/apache/
│ └── 000-default.conf # DocumentRoot = /var/www/aigo/public
├── aigo/ # Laravel source (git-tracked)
│ ├── app/
│ ├── config/
│ ├── routes/
│ ├── resources/ # Blade views, JS (echo.js), CSS
│ ├── public/ # Static assets, build output
│ ├── composer.json
│ ├── package.json
│ └── ...
└── humicpro_aigo.sql # Database dump (auto-imported by MySQL)
Build Stages
| Stage | Image | Purpose |
|---|---|---|
composer |
composer:2.7 |
composer install --no-dev |
npm |
node:20-slim |
npm ci && npm run build (compiles VITE_* vars into JS) |
runtime |
php:8.2-apache |
Apache + PHP with mod_rewrite, pdo_mysql, redis |
Deploy to Coolify
- Push this repo to GitHub/GitLab
- In Coolify, create a new project → select your repo
- Coolify auto-detects
docker-compose.yml - Set these environment variables in Coolify's UI:
Required
| Variable | Description | How to get it |
|---|---|---|
APP_URL |
Your domain | https://your-domain.com |
APP_KEY |
Laravel encryption key | Run php artisan key:generate --show locally |
DB_PASSWORD |
MySQL user password | Choose a secure password |
DB_ROOT_PASSWORD |
MySQL root password | Choose a secure password |
WebSocket (Reverb)
| Variable | Description | Example |
|---|---|---|
VITE_REVERB_HOST |
Your Coolify domain | your-domain.com |
VITE_REVERB_PORT |
WebSocket port | 8080 |
VITE_REVERB_SCHEME |
https if Traefik handles TLS |
https |
These VITE_* vars are build args — they get compiled into the JS bundle. To change them, update the env var in Coolify and rebuild.
Optional
| Variable | Default |
|---|---|
STRAVA_CLIENT_ID |
124405 |
STRAVA_CLIENT_SECRET |
(leave blank if not used) |
REVERB_APP_ID |
103594 |
REVERB_APP_KEY |
zlno4t94kysjzmtwlmux |
REVERB_APP_SECRET |
7zpl1vq4qvvotvrodq2u |
- In the reverb service settings, expose port 8080 via Traefik
- Deploy — MySQL auto-imports
humicpro_aigo.sqlon first startup
Architecture
Browser ──HTTPS──> Coolify/Traefik ──> app container (port 80 / Apache)
Browser ──WSS──> Coolify/Traefik ──> reverb container (port 8080 / Reverb WebSocket)
Services
| Service | Image | Purpose |
|---|---|---|
app |
Built from Dockerfile | Apache + PHP-FPM, serves the Laravel app |
reverb |
Same image | Runs php artisan reverb:start for real-time WebSocket |
queue |
Same image | Runs php artisan queue:work for background jobs |
db |
mysql:8.0 |
MySQL database with auto-import of SQL dump |
Maintenance
- Storage: Persistent volume
aigo-storageat/var/www/aigo/storage - Database: Persistent volume
dbdataat/var/lib/mysql - Logs: Available via
docker compose logs -f [service] - To change domain: Update
APP_URL+VITE_REVERB_HOSTin Coolify, rebuild
Description
Languages
Blade
42.3%
PHP
26.6%
CSS
18.8%
JavaScript
11.8%
Dockerfile
0.3%
Other
0.2%