Skip to content

Commit 34e6a96

Browse files
committed
Changed README
1 parent 9fae747 commit 34e6a96

File tree

1 file changed

+57
-19
lines changed

1 file changed

+57
-19
lines changed

README.md

Lines changed: 57 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,62 @@
11
### Introduction
2-
Provide Docker environment configuration for Laravel development.
3-
Repo includes:
4-
- Laravel 6
5-
- PHP 7.4
6-
- Nginx: 1.14
7-
- MySql 8.0
8-
- Redis
9-
- Node latest
2+
Docker environment configuration for Laravel development.
3+
Includes local end production settings.
4+
>Repository provides:
5+
> - Laravel 6
6+
> - PHP 7.4
7+
> - Nginx: 1.14
8+
> - MySql 8.0
9+
> - Redis
10+
> - Node latest
1011
11-
Branch `develop` consist of local and production configuration.
12-
13-
14-
###Installation
15-
1. ````cp .env.example .env && cp docker-compose.yml.local docker-compose.yml ````
16-
2. Set PROJECT_NAME variable in `.env` file
17-
3. Set database variables in `docker-compose.yml`
12+
### Installation
13+
**Note:** Local environment tested only on Ubuntu. Feel free create an Issue for other OS.
14+
1. **Clone repository**
15+
````
16+
mkdir {YOUR_PROJECT_FOLDER}
17+
cd {YOUR_PROJECT_FOLDER}
18+
git clone [email protected]:dmsemenov/laravel-docker-environment.git .
19+
````
20+
2. **Configure main `.env` file**
21+
````
22+
cp .env.example .env
23+
````
24+
Set PROJECT_NAME variable.
25+
Set PROJECT_FOLDER variable for example `backend` or whatever you want - by default it is main.
26+
3. **Configure main `docker-compose.yml` file**
27+
````
28+
cp docker-compose.yml.local docker-compose.yml
29+
````
30+
Set variables for mysql container. Docker will create database and user at first UP.
31+
MYSQL_ROOT_PASSWORD:
32+
MYSQL_DATABASE: ${PROJECT_NAME}
33+
MYSQL_USER: ${PROJECT_NAME}
34+
MYSQL_PASSWORD:
35+
4. **Configure App `.env`**
1836
````
19-
# By default ${PROJECT_FOLDER}=main
20-
cp ${PROJECT_FOLDER}/.env.example cp ${PROJECT_FOLDER}/.env
37+
# By default ${PROJECT_FOLDER}=main
38+
cp ${PROJECT_FOLDER}/.env.example cp ${PROJECT_FOLDER}/.env
2139
````
40+
Set variables from *step 3*
41+
DB_HOST=mysql
42+
DB_DATABASE=
43+
DB_USERNAME=
44+
DB_PASSWORD=
2245
23-
4. Set database config in `${PROJECT_FOLDER}/.env`
24-
``docker-compose exec php-fpm php artisan key:generate``
46+
5. **Run Application**
47+
````
48+
docker-compose up -d --build
49+
docker-compose exec -uwww-data php-fpm composer install
50+
docker-compose exec php-fpm php artisan key:generate
51+
# Base UI
52+
docker-compose exec -uwww-data php-fpm composer require laravel/ui --dev
53+
docker-compose exec -uwww-data php-fpm php artisan ui bootstrap --auth
54+
55+
# Build frontend
56+
docker-compose run --rm --no-deps -unode node bash -ci 'npm i&&npm run dev'
57+
58+
# Migrate
59+
docker-compose exec -uwww-data php-fpm php artisan migrate
60+
````
61+
6. **Run http://localhost:8989/register**
62+

0 commit comments

Comments
 (0)