Create .env
file based on .env.example
:
cp .env.example .env
Run containers:
CURRENT_UID=$(id -u):$(id -g) docker-compose up -d --build
Fetch dependencies:
composer install
npm install
Generate application key:
php artisan key:generate
Generate assets:
php artisan nova:publish
php artisan telescope:publish
npm run dev
Run PHP (with command instead of *
):
docker-compose run -u "$(id -u):$(id -g)" php *
Like that:
docker-compose run -u "$(id -u):$(id -g)" php -v
docker-compose run -u "$(id -u):$(id -g)" php ./vendor/bin/behat
Go into PHP container:
docker exec -it -u "$(id -u):$(id -g)" brewmap-php sh
Run Composer (with command instead of *
):
docker-compose run -u "$(id -u):$(id -g)" php composer *
Like that:
docker-compose run -u "$(id -u):$(id -g)" php composer -V
docker-compose run -u "$(id -u):$(id -g)" php composer show
docker-compose run -u "$(id -u):$(id -g)" php composer dump-autoload
You can run Psalm (for static code analysis), Behat (for tests) and ECS (for code style) via Composer:
docker-compose run -w /application -u "$(id -u):$(id -g)" php composer psalm
docker-compose run -w /application -u "$(id -u):$(id -g)" php composer behat
docker-compose run -w /application -u "$(id -u):$(id -g)" php composer ecs
Run Node (with command instead of *
):
docker-compose run -u "$(id -u):$(id -g)" node *
Like that:
docker-compose run -u "$(id -u):$(id -g)" node npm -v
docker-compose run -u "$(id -u):$(id -g)" node npm install
Go into Node container:
docker exec -it -u "$(id -u):$(id -g)" brewmap-node sh