Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mnr73/laravel-docker-compose
run latest Laravel version with docker compose
https://github.com/mnr73/laravel-docker-compose
docker dockercompose laravel
Last synced: 2 months ago
JSON representation
run latest Laravel version with docker compose
- Host: GitHub
- URL: https://github.com/mnr73/laravel-docker-compose
- Owner: mnr73
- Created: 2024-04-02T19:53:24.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-06-22T09:19:45.000Z (6 months ago)
- Last Synced: 2024-09-28T21:03:55.212Z (3 months ago)
- Topics: docker, dockercompose, laravel
- Language: PHP
- Homepage:
- Size: 112 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## About this Laravel fresh repo
this laravel repo provide simple docker files and docker compose to run Laravel for develop and production purpose.
this repo is contain three docker compose files.- docker-compose-common.yml : the base of docker compose files
- docker-compose-prd.yml : docker compose file for production
- docker-compose.yml : docker compose file for development in localto work with this docker compose files you need docker base knowledge.
docker files placed in /mnr_docker directory.
in additional add [Laravel ide helper](https://github.com/barryvdh/laravel-ide-helper) package and put some setting for auto generate files. for auto generate files you need this [run on save](https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave) extension for vsCode.
## How to use
- step 1: clone repo
- step 2 (optional): you can remove /.git directory and initial repo again
- step 3: cp .env.example to .env
- step 4: the default database in .env file is sqlite if you want continue to use taht you can comment or remove mysql and phpMyAdmin services in docker compose files. or change DB_CONNECTION value to mysql in .env file. change env file like below lines to use mysql. if you want user other databases you should change docker compose files.```
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=laravel
DB_PASSWORD=password
```- step 5: change other env variable if you need and run `docker compose up -d`
- step 6: run `docker compose exec -it -u 1000 laravel composer install`
- step 7: run `docker compose exec -it -u 1000 laravel php artisan key:generate`
- step 8: run `docker compose exec -it -u 1000 laravel php artisan migrate`
- step 9: open [localhost](http://localhost) to see laravel welcome page