The Enso Command
Getting Started
Enso comes with the files necessary to run your project in docker. If you don't already have them you can publish them using Artisan.
php artisan vendor:publish --tag docker
If you are having problems with the above command you can also use a disposable Docker container to do this.
docker run --rm -it -v $(pwd):/opt -w /opt shippingdocker/php-composer:latest php artisan vendor:publish --tag docker
The Enso Command
The docker installation comes with a bash script called ./enso. This provides simple access to commands on different docker containers. It is essentially a wrapper around docker-compose.
If you want to know what this command is doing behind the scenes, take a look at the enso file. It's fairly easy to read.
Setting up an alias
You will probably want so set up an alias for enso. Add the following to your ~/.bash_profile.
alias enso='./enso'
The examples below assume that you've done this.
start
enso start
This will start all of the containers. They will be built if they don't already exist.
stop
enso stop
This will stop all of the containers. Databases etc will be preserved.
artisan
enso artisan migrate
enso artisan db:seed
enso artisan key:generate
composer
enso composer install
enso composer require some/package
test
enso test
Run phpunit.
npm
enso npm install
enso npm run dev
yarn
enso yarn install
enso yarn add lodash
bash
enso bash
Start an interactive bash console on the app container.
Anything else
If you don't provide an argument (e.g. just type enso) it will run docker-compose ps and show you a list of running docker containers.
If you pass anything that isn't in the above list, it will be passed to docker-compose. E.g. enso logs would be the same as docker-compose logs.