You can use your local laptop to do development, we are just using Docker to host the website. So let's get your local machine ready.
npm install
Build the Docker Containers we need:
docker run --rm -v $(pwd):/app composer install
docker-compose up -d
Now we can setup our Laravel App in Docker
docker-compose exec app php artisan key:generate
docker-compose exec app php artisan config:cache
Now that we have all the dependencies installed, we can build the website.
Generated Static Assets for Development Environment ( Source Maps & Uncompressed Assets ).
npm run dev
Generated Static Assets for Development Environment ( No Source Maps & Compressed Assets ).
npm run production
Now you can open your web browser to http://127.0.0.1:8000
From your local development machine, you can manage our docker containers using docker-compose
command | description |
---|---|
docker-compose up -d |
Start Docker Services |
docker-compose stop |
Stop Docker Services |
docker-compose restart |
Restart Docker Services |
docker-compose logs |
View output from Docker containers |
docker-compose down |
Stop and remove Docker Containers, Networks, Images & Volumes |
Since you will likely be running NPM commands, these custom Docker NPM Scripts might come in handy.
command | description |
---|---|
npm run docker:start |
Start Docker Services |
npm run docker:stop |
Stop Docker Services |
npm run docker:restart |
Restart Docker Services |
npm run docker:logs |
View output from Docker containers |
npm run docker:down |
Stop and remove Docker Containers, Networks, Images & Volumes |
npm run docker:clean |
Run Laravel Clean Commands to Reset PHP Application |