cnb / dockerino
Dockerized development environment for laravel
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 1 490
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.1.0
- illuminate/console: ~5.1
- illuminate/contracts: ~5.1
- illuminate/support: ~5.1
- symfony/var-dumper: ~3.0|~4.0
- vlucas/phpdotenv: ^2.4
Requires (Dev)
- phpunit/phpunit: ~4.0|~5.0
This package is not auto-updated.
Last update: 2019-08-02 15:57:12 UTC
README
A simple Artisan extension that enables creation of required services with docker, bsaed on the content of the .env file
Setup
First make sure you created your own .env file, based on the .env.example that is likely to be found in any Laravel project,
cp .env.example .env
Commands
The available commands are pretty self explanatory, calling php artisan
will show (amongst others), the following:
docker:destroy Destroy Docker machines docker:start Start Docker services, based on .env docker:state Get Docker state docker:stop Stop Docker
MySQL & Redis
Dockerino will read the env file and (do its best to) figure out what are the services required to run your project correctly. The extension will ignore most sections, except for those that are related to external services. For example if the .env contains something like
DB_CONNECTION=mysql DB_HOST=localhost DB_PORT=3306 DB_DATABASE=myapp DB_USERNAME=root DB_PASSWORD=SECRET
Dockerino will create a docker machine shaped after this configuration. As of now all machines will only have the root user, this is convenient, since root doesn't require additional grants, which can slow down development.
if DB_CONNECTION
is something other than MySQL, it will skip it and not create the service.
Same goes for Redis. If QUEUE_DRIVER=redis
Dockerino will be looking for a section like
REDIS_HOST=rocketpostredis.devel REDIS_PASSWORD=password REDIS_PORT=6379
and if found it will create the appropriate services.
What's next
Next, you can serve your app locally with:
php artisan serve
and if you specified localhost as your host(s) everything should run fine.
If your host is something other than localhost, you'd have to update you etc/hosts
file or
use a service like dnsmasq to redirect certain
domains to your local machine.
If you're running your machine in apache or nginx you have to make sure your docker machines are accessible from the application.