Skip to content

Instantly share code, notes, and snippets.

@XIOLog
Last active April 19, 2021 14:46
Show Gist options
  • Select an option

  • Save XIOLog/3864623a241aa901aef66b93e4bed4b7 to your computer and use it in GitHub Desktop.

Select an option

Save XIOLog/3864623a241aa901aef66b93e4bed4b7 to your computer and use it in GitHub Desktop.
Install Sail Laravel after Git clone (WSL 2, Windows 10)

First step

curl -s https://laravel.build/example-app | bash

Instead of "example-app" it can be any site name.

Or another steps

After using "git clone", use this commands in the terminal:

Clone from .env.example to .env and check these values:

APP_URL=http://example-app.test

DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=example_app
DB_USERNAME=sail
DB_PASSWORD=password

MEMCACHED_HOST=memcached

REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379

Generate vendor directory and start the container

$ docker run --rm \
    -u "$(id -u):$(id -g)" \
    -v $(pwd):/opt \
    -w /opt \
    laravelsail/php80-composer:latest \
    composer install --ignore-platform-reqs
    
$ sail up -d

If you changed "docker-compose.yml", stop the container in the docker and run it again:

$ sail down
$ sail build --no-cache
$ sail up -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment