A pretty simplified Docker setup of containers for local Laravel development. You can view the full repository and article that inspired this repo under:
- https://github.com/aschmelyun/docker-compose-laravel
- https://www.digitalocean.com/community/tutorials/how-to-containerize-a-laravel-application-for-development-with-docker-compose-on-ubuntu-18-04
To get started, make sure you have Docker installed on your system.
- Clone this repository
git clone https://github.com/adpe/laravel-docker-demo.git
- Navigate to the directory you cloned this repository.
- Build or pull image
docker pull adpe/laravel-demo:mssql
and spin up the containers for the web server by runningdocker-compose up -d
. - Cleanup and prepare
www
directory, rundocker-compose exec app rm .gitkeep
. - After that create a new Laravel project with
docker-compose exec app composer create-project laravel/laravel .
or provide your existing Laravel project files in thewww
directory, run if your provide a existing project and neccesary these commands:docker-compose exec app composer install
docker-compose exec app php artisan key:generate
- Now go to your browser and access your server's domain name or IP address on port 8000 (http://server_domain_or_IP:8000)