base image using image from serversideup/php this single docker image already contains nginx, php-fpm, scheduler and queue (worker or horizon) all this process worked using s6-overlay
-
clone this repository
git clone https://github.com/jhonoryza/serversideup-laravel.git cd serversideup-laravel
-
clone your laravel app repository to src folder
composer create-project laravel/laravel src
-
create
env
file, and fill it with your laravel env variables -
check docker-compose.yml file, you can adjust networks, ports, image and container name as you want
-
build docker image run
./build.sh
or run with argumentbash build.sh laravel-app:latest 8.0 n n
-
running the container
docker-compose up -d
- to stop the container
docker-compose down
- you need to login to the container using this command
docker exec -it -u webuser laravel-app bash
which laravel-app is the container name, you need to change these if you change the container name
- some common artisan commands:
php artisan key:generate
php artisan clear-compiled
php artisan optimize
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear
php artisan livewire:publish --assets
php artisan livewire:discover