The Enso Command
Getting Started
Installing via Composer
Install the enso-docker package.
composer require yadda/enso-docker
Add the service provider to your app:
// config/app.php
'providers' => [
// ...
Yadda\Enso\Docker\EnsoDockerServiceProvider::class,
// ...
]
Use the service provider to publish the files that you need.
# You can publish all the things that need publishing
php artisan vendor:publish
# Or only publish the files from this package
php artisan vendor:publish --provider="Yadda\Enso\Docker\EnsoDockerServiceProvider"
Installing Manually
I don't recommend this but if you're stuck getting things working you can just copy everything from /src into the root of your project. This might be handy if you're having problems running php artisan or composer on the command line. There are more sophisticated ways around this, e.g. by creating a temporary docker container to run those commands in. See the Vessel docs to see how they do it.
Setting up an alias
Typing ./enso all the time is annoying, so set up an alias. Add the following to your ~/.bash_profile.
alias enso='./enso'
The examples below assume that you've done this.
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.
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.