Skip to content

Template for creating a local Laravel environment with Docker

Notifications You must be signed in to change notification settings

salah-jr/Laravel-Docker-Skeleton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Docker Skeleton

A lightweight Docker container that sets up the basic containers for a local Laravel development.

Installation

  • Make sure you have Docker and Docker compose installed on your system, and then clone this repository. Or click (Use this template) button to create a new repository based on this template and clone it.
  • Navigate in your terminal to the directory you cloned, and spin up the containers for the web server by running docker-compose up -d --build app.
  • After that completes, Clone or create your laravel project inside the src directory.

Note: Your MySQL database host name in .env should be mysql (The database container name in docker-compose file), not localhost. The username, password and database should both be the same in .env file and docker-compose file.

Note: If you want to use PostgreSql instead of MySql uncomment the postgres and pgadmin containers in docker-compose.yml file.


Ports

  • nginx - :80 (To access your app write 127.0.0.1:80 in your browser)
  • mysql - :3306
  • phpmyadmin - :8081
  • postgres - :3000
  • pgadmin - :82
  • php - :9000
  • redis - :6379
  • mailhog - :8025

You can use composer, npm and artisan from the container like this:

  • docker-compose run --rm artisan make:controller
  • docker-compose run --rm composer install
  • docker-compose run --rm npm install

Here is an example of a real Laravel project built on this docker template.

About

Template for creating a local Laravel environment with Docker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published