Skip to content

igorcfernandes/setup-docker-laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker setup for Laravel projects

Steps

Clone the setup-docker-laravel repository

git clone https://github.com/igorcfernandes/setup-docker-laravel.git

Clone laravel repository

git clone https://github.com/laravel/laravel.git laravel-app

Copy the docker-compose.yml and Dockerfile files and the docker/ directory inside your project

cp -rf setup-docker-laravel/* laravel-app/

Go to your project folder

cd laravel-app/

Create the .env file

cp .env.example .env

Update the environment variables in .env file

APP_URL=http://localhost:8000

DB_CONNECTION=mysql
DB_HOST=db
DB_DATABASE=laravel
DB_USERNAME=username
DB_PASSWORD=password

CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis

REDIS_HOST=redis

Start all the services

docker-compose up -d

Run the following shell command inside the app container to interact with the running container

docker-compose exec app bash

Install the project dependencies

composer install

Generate the laravel project key

php artisan key:generate

Access the project http://localhost:8000

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published