This is a repository for building Laravel environment with docker (docker-compose). The base container image of the software used and its version are as follows.
Software | base container image |
---|---|
php | 7.3-fpm-alpine |
mysql | 8.0 |
nginx | 1.17-alpine |
redis | 5.0-alpine |
node | 13.10-alpine |
❯ docker -v
Docker version 19.03.5, build 633a0ea
❯ docker-compose -v
docker-compose version 1.24.1, build 4667896b
❯ docker-compose build
❯ docker-compose up -d
or
❯ docker-compose up -d --build
❯ docker-compose exec app [ service name ] ash [ command ( ex: php -v ) ]
❯ docker-compose down
❯ docker-compose exec app ash
/work # composer create-project --prefer-dist "laravel/laravel=6.0.*" .
/work # php artisan -V
Laravel Framework 6.6.1
$ docker-compose exec db bash -c 'mysql -uroot -p${MYSQL_PASSWORD} ${MYSQL_DATABASE}'