When you download a laravel project from github it comes without the vendor
folder, so it's needed to install it with a temporary container.
Docker and docker compose must be previously installed. If you don't have it, follow those guides:
- https://docs.docker.com/engine/install/ubuntu/ (search for "Install using the convenience script")
- Follow the Post install procedures: https://docs.docker.com/engine/install/linux-postinstall/
- Install docker compose plugin (V2): https://docs.docker.com/compose/install/linux/
When your docker and compose are ready, you can configure laravel:
- Clone your laravel project from github.
chmod -R a+rw .
- Run a temporary container to install composer dependencies:
docker run --rm \
-u "$(id -u):$(id -g)" \
-v "$(pwd):/var/www/html" \
-w /var/www/html \
laravelsail/php82-composer:latest \
composer install --ignore-platform-reqs
Reference: https://laravel.com/docs/10.x/sail#installing-composer-dependencies-for-existing-projects
- Make sure sail shell alias is set (zshrc or bashrc):
Reference: https://laravel.com/docs/10.x/sail#configuring-a-shell-alias
- Make sure to fill
.env
(usually you should have a.env.example
in project's root).
sudo chown -R $USER:docker storage/framework
Check if your .env
hosts are pointing to container names instead of localhost/127.0.0.1