- Docker Desktop (for Windows or Mac)
- Docker CE (for Linux)
-
Copy the content .env.example and paste it into .env
-
Run docker compose command.
docker compose up -d --build
-
Once everything is okay, run this command below to install Laravel dependencies.
docker exec -it php bash; composer install; php artisan migrate;
-
You can visit https://laravel-docker-base.localtest.me to visit the site.
-
Additionally, you can test run the tests using this command as well.
php artisan test;
-
To close the docker compose, please run this.
docker compose down;
-
To run nodejs related stuff, you can use command below.
docker compose run --rm yarn install; docker compose run --rm yarn dev; docker compose run --rm yarn build;
-
Docker Build Instructions
docker build --no-cache --network host --file ./docker/php/Dockerfile --target php-production --build-arg CURRENT_ENVIRONMENT=production -t xbbshampoo/laravel-test-app:latest .; docker build --no-cache --network host --file ./docker/nginx/Dockerfile --target webserver-production -t xbbshampoo/laravel-test-nginx:latest .; docker push xbbshampoo/laravel-test-nginx:latest; docker push xbbshampoo/laravel-test-app:latest;