Setting up your own domain
- Setup domains in Caddyfile, then restart caddy
docker-compose restart proxy
. Example:
Before
bash
http://admin.wellms.localhost {
reverse_proxy admin:80
}
http://app.wellms.localhost {
reverse_proxy app:80
}
http://api.wellms.localhost {
reverse_proxy api:80
}
http://mailhog.wellms.localhost {
reverse_proxy mailhog:8025
}
After
bash
admin.escolalms.com {
reverse_proxy admin:80
}
demo.escolalms.com {
reverse_proxy app:80
}
api.escolalms.com {
reverse_proxy api:80
}
mailhog.escolalms.com {
reverse_proxy mailhog:8025
}
NOTE Settings above will automatically create you SSL Lets Encrypt Certification.
- Change
API_URL
indocker-compose.yml
, and restart dockers withmake restart
.
Before
yml
environment:
- API_URL=http://api.wellms.localhost
After
yml
environment:
- API_URL=https://api.escolalms.com
- Edit
APP_URL
in.env
file
yml
APP_URL=http://api.wellms.localhost/
After
yml
APP_URL=https://api.escolalms.com/
- Clear Laravel Cache, enter bash by calling
make bash
then call artisan commandsoptimize:clear
andresponsecache:clear
bash
➜ Create-LMS-App git:(main) make bash
docker-compose exec -u 1000 api bash
devilbox@0d6a75afa279:/var/www/html$ php artisan optimize:clear
Cached events cleared!
Compiled views cleared!
Application cache cleared!
Route cache cleared!
Configuration cache cleared!
Compiled services and packages files removed!
Caches cleared successfully!
devilbox@0d6a75afa279:/var/www/html$ php artisan responsecache:clear
Response cache cleared!
Scaling php-fpm, Horizon & Scheduler.
By default all 3 threads phpfpm, Laravels Horizon and Scheduler are severed by one image container
php-fpm
serve main Laravel REST API (with nginx and caddy)horizon
is responsible for all queue servicesTask Scheduling
is responsible for all cron jobs
All of above including nginx are served by supervisor
, definition files are listed here
You can scale this by setting each process into separate image container, just by amending docker-compose.yml
in the following way
yml
# NOTE binding emptyfile.conf disable supervisor service
api:
image: escolalms/api:latest
networks:
- escola_lms
volumes:
- ./emptyfile.conf:/etc/supervisor/custom.d/horizon.conf
- ./emptyfile.conf:/etc/supervisor/custom.d/scheduler.conf
# - ./emptyfile.conf:/etc/supervisor/custom.d/nginx.conf
- ./storage:/var/www/html/storage
- ./.env:/var/www/html/.env
horizon:
image: escolalms/api:latest
networks:
- escola_lms
volumes:
# - ./emptyfile.conf:/etc/supervisor/custom.d/horizon.conf
- ./emptyfile.conf:/etc/supervisor/custom.d/scheduler.conf
- ./emptyfile.conf:/etc/supervisor/custom.d/nginx.conf
- ./storage:/var/www/html/storage
- ./.env:/var/www/html/.env
scheduler:
image: escolalms/api:latest
networks:
- escola_lms
volumes:
- ./emptyfile.conf:/etc/supervisor/custom.d/horizon.conf
# - ./emptyfile.conf:/etc/supervisor/custom.d/scheduler.conf
- ./emptyfile.conf:/etc/supervisor/custom.d/nginx.conf
- ./storage:/var/www/html/storage
- ./.env:/var/www/html/.env