Skip to content

Instantly share code, notes, and snippets.

@victorhugorch
Created January 13, 2018 15:30
Show Gist options
  • Select an option

  • Save victorhugorch/e7f91bd21d60a85e9437c29773c71e94 to your computer and use it in GitHub Desktop.

Select an option

Save victorhugorch/e7f91bd21d60a85e9437c29773c71e94 to your computer and use it in GitHub Desktop.
Shell script to initialize a docker enviroment for Laravel projects.
#!/bin/bash
echo Uploading Application container
docker-compose up -d
echo Copying the configuration example file
docker exec -it <app-name>-app cp .env.example .env
echo Install dependencies
docker exec -it <app-name>-app composer install
echo Generate key
docker exec -it <app-name>-app php artisan key:generate
echo Make migrations
docker exec -it <app-name>-app php artisan migrate
echo Make seeds
docker exec -it <app-name>-app php artisan db:seed
echo Information of new containers
docker ps -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment