Skip to content
On this page

Setting up your own domain

  1. 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.

  1. Change API_URL in docker-compose.yml, and restart dockers with make restart.

Before

yml
environment:
  - API_URL=http://api.wellms.localhost

After

yml
environment:
  - API_URL=https://api.escolalms.com
  1. Edit APP_URL in .env file
yml
APP_URL=http://api.wellms.localhost/

After

yml
APP_URL=https://api.escolalms.com/
  1. Clear Laravel Cache, enter bash by calling make bash then call artisan commands optimize:clear and responsecache: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

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