I've boiled it down so I'll leave it in the article
simotaroo's How to build Laravel + Vue execution environment (LEMP environment) with Docker that never fails, or those who have already built laravel, PHP environment with docker
mac
docker (LEMP environment)
Add the following to any docker file and rebuild
dockerfile
RUN apt-get -y install libzip-dev
RUN docker-php-ext-install zip
RUN apt-get -y install libnss3
RUN apt-get -y install libasound2-data libasound2 xdg-utils
RUN apt install sudo
RUN apt-get install -y wget
RUN apt-get install -y gnupg2
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
RUN sudo apt update
RUN sudo apt-get install -y google-chrome-stable
RUN apt-get install -y fonts-ipafont
Rewrite APP_URL in .env
.env
APP_URL = http://localhost
APP_URL=http://127.0.0.1:Rewritten to 8000
Rewrite tests/DuskTestCase.php
tests/DuskTestCase.php
protected function driver()
{
$options = (new ChromeOptions)->addArguments([
'--no-sandbox',
'--disable-gpu',
'--headless',
'--window-size=1920,1080',
'--lang=ja_JP',
]);
In the project after installation
composer require --dev laravel/dusk:
artisan dusk:install
php artisan serve
Then test execution
php artisan dusk
PHPUnit 8.5.8 by Sebastian Bergmann and contributors.
. 1 / 1 (100%)
Time: 11.2 seconds, Memory: 24.00 MB
OK (1 test, 1 assertion)
If successful, it is completed successfully
Recommended Posts