Install sudo, docker and docker-compose. Don't forget to add user to docker
group.
On Debian Jessie as root:
apt-get install -y sudo
usermod -aG sudo <user>
wget -qO- https://get.docker.com/ | sh
# or use curl:
# curl -L http://get.docker.com/ | sh
usermod -aG docker <user>
apt-get install -y python-pip
pip install docker-compose
- Create your laravel project
- Clone this repository into
docker
directory - Make
storage
directory writeable for everyone
# Run containers
docker-compose -f docker/docker-compose.yml up -d
# Run composer
docker-compose -f docker/docker-compose.yml run composer install
# Run artisan
docker-compose -f docker/docker-compose.yml run artisan migrate:install
You use up
helper script:
docker/up composer install
You can create shortcut at root of your project:
ln -s docker/up laravel
Run:
./laravel up -d
./laravel composer update
./laravel artisan migrate:refresh --seed
P.S. Default laravel database host is localhost
. At docker infrastructure host is database
.
So you must specify it at config/database.php
or .env
file:
DB_HOST=database