Skip to content

This shows how i set up a docker container for Nginx, PHP, MySQL, Redis and MongoDB

Notifications You must be signed in to change notification settings

bunday/Laravel-Docker-Setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel-Docker-Setup

This shows how i set up a docker container for Nginx, PHP, MySQL, Redis and MongoDB. You can remove any service you dont need as well as add new ones.

The src folder should be your laravel project folder.

If you change the name from src, ensure you change it in the docker-compose.yml

After setting this up, run the following commands

docker-compose build
docker-compose up -d

You should have all the images running.

docker ps will list your list your images.

You can visit http://localhost:8080 to see your laravel app. If you change the port in the docker-compose.yml file, then replace the 8080 here as well.

Accessing Laravel project to run composer commands: eg composer update

docker-compose exec php php /usr/local/bin/composer update

Accessing my laravel project to run artisan: eg php artisan migrate

docker-compose exec php php /var/www/artisan migrate 

Resources that helped me do this

https://dev.to/aschmelyun/the-beauty-of-docker-for-local-laravel-development-13c0

Happy Coding 🎉

About

This shows how i set up a docker container for Nginx, PHP, MySQL, Redis and MongoDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published