Requirements:
- Docker, docker-compose on local
- terminal
- Clone projects and prepare vendor
git clone [email protected]:hnojedu/scores.git
cd scores
mkdir -p ./vendor/laravel
- Download Laravel Sail
git clone https://github.com/laravel/sail.git ./vendor/laravel/sail
- Setting env
cp .env.example .env
Changed if needed:
- APP_PORT: port to run page
- FORWARD_DB_PORT: port to access mysql via host machine
- DB_PASSWORD: root password
- APP_URL: ensure it's sync with APP_PORT, or FE can not call API
- Start docker-compose
./vendor/laravel/sail/bin/sail up -d
- Install app
./vendor/laravel/sail/bin/sail composer install
./vendor/laravel/sail/bin/sail php artisan key:generate
- create database and migrage
docker exec scores-mysql-1 mysql -uroot -proot -e "CREATE DATABASE scores CHARACTER SET utf8mb4"
./vendor/laravel/sail/bin/sail php artisan migrate
- Recreate app. Done
./vendor/laravel/sail/bin/sail up -d
App run at (by default): http://localhost:8082
ask @zy666