https://github.com/willavelar/docker-for-laravel
files for laravel configuration with docker, mysql and redis
https://github.com/willavelar/docker-for-laravel
docker docker-compose laravel mysql redis
Last synced: 4 months ago
JSON representation
files for laravel configuration with docker, mysql and redis
- Host: GitHub
- URL: https://github.com/willavelar/docker-for-laravel
- Owner: willavelar
- Created: 2023-12-01T12:55:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-01T17:33:22.000Z (over 2 years ago)
- Last Synced: 2025-03-03T02:45:05.958Z (over 1 year ago)
- Topics: docker, docker-compose, laravel, mysql, redis
- Language: Dockerfile
- Homepage:
- Size: 89.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker for Laravel
 
Files for quick Laravel configuration with Docker Compose, customizable for different version levels
-----
### Instalation
1. Clone this repository
```sh
git clone https://github.com/willavelar/docker-for-laravel.git
```
2. Clone the Laravel repository
```sh
git clone https://github.com/laravel/laravel.git app-laravel
```
3. Copy the files from this project to laravel
```sh
cp -rf laravel-with-docker/* app-laravel/
```
```sh
cd app-laravel/
```
4. Create the .env file
```sh
cp .env.example .env
```
5. Add the following lines at the end of .gitignore
```dosgitignore
/.docker
```
6. Create .env file in laravel project
```sh
cp .env.example .env
```
7. Update the .env file environment variables
```dosini
APP_NAME="Webapp name"
APP_URL=http://localhost:8989
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=root
CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379
```
8. Upload project containers
```sh
docker-compose up -d
```
9. Access the container
```sh
docker-compose exec app bash
```
10. Install project dependencies
```sh
composer install
```
11. Generate the Laravel project key
```sh
php artisan key:generate
```
Acessar o projeto
[http://localhost:8989](http://localhost:8989)