Skip to content

Instantly share code, notes, and snippets.

@WisdomSky
Last active March 23, 2024 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save WisdomSky/737ee5e158793724717eebed25816ef9 to your computer and use it in GitHub Desktop.
Save WisdomSky/737ee5e158793724717eebed25816ef9 to your computer and use it in GitHub Desktop.
Install Laravel from Git Bash + Docker

1.) Set target directory

export LARAVEL_APP=laravel

The value of LARAVEL_APP will be the name of the directory where the laravel app will be created relative to your current working directory in git bash.

2.) Install Laravel via Docker

docker run --rm \
    --pull=always \
    -v "/$(pwd)":/opt \
    -w //opt \
    laravelsail/php82-composer:latest \
    bash -c "laravel new ${LARAVEL_APP}  && cd ${LARAVEL_APP} && php ./artisan sail:install"

Wait until the installation si completed.

3.) Start Laravel docker app

docker compose up -d

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment