|
6 | 6 | * API Laravel Boilerplate 5.5
|
7 | 7 | * Apache 2
|
8 | 8 | * MySQL
|
| 9 | +* Xdebug |
9 | 10 | * Docker
|
10 | | - |
11 | | -## Docker Environments |
12 | 11 |
|
13 | | -### Swarm Mode |
14 | | -Clone this respository and run the following commands: |
15 | | -```bash |
16 | | -cd docker-laravel-api-dev/ |
17 | | -# Creating mount folder |
18 | | -mkdir .docker/local-mysql-datadir |
19 | | -docker stack deploy -c docker-compose.yml docker-laravel-api-dev |
20 | | -# wait for it and follow the docker instructions!... |
21 | | -``` |
22 | | -### Docker Compose |
23 | | -Clone this respository and run the following commands: |
24 | | -```bash |
25 | | -cd docker-laravel-api-dev/ |
26 | | -docker-compose -f docker-compose.yml up --build -d |
27 | | -# wait for it to build and follow the docker instructions!... |
28 | | -``` |
29 | | -### PWD |
30 | | -With Play with Docker and following the docker instructions, it is easy to deploy and test this environment! |
| 12 | +## Environments |
| 13 | + |
| 14 | +To deploy this api boilerplate, there are three options (yaml) and Docker environments with instructions that you should consider: |
31 | 15 |
|
32 | | -[](http://play-with-docker.com?stack=https://raw.githubusercontent.com/jfernancordova/docker-laravel-api-dev/master/docker-compose-pwd.yml) |
| 16 | +### Dev or Local Mode |
| 17 | +* docker-compose-dev.yml: generate automatically folders and require-dev dependencies on your local workspace including Xdebug, however the yaml file has a key called: |
| 18 | +"XDEBUG_MODE", this yaml by default has the value true (1) to install it. |
33 | 19 |
|
34 | | -## Docker Instructions |
| 20 | +You can appreciate the dependencies generated automatically on your workspace! |
| 21 | + |
| 22 | +### Play with Docker Mode |
| 23 | +* docker-compose-pwd.yml: you can [](http://play-with-docker.com?stack=https://raw.githubusercontent.com/jfernancordova/docker-laravel-api-dev/feature/refactoring/docker-compose-pwd.yml), to visualize this environment and test it, however you should see the container lists to verify the HEALTHCHECK. |
35 | 24 |
|
36 | | -### Execute Laravel Pre-requisites |
37 | | -In the root directory: |
38 | 25 | ```bash
|
39 | 26 | # container lists
|
40 | 27 | docker ps
|
41 | | -# next, execute an interactive bash shell on the php container. |
42 | | -docker container exec -t -i [dockerlaravelapidev_php_1 or container Id] bash |
| 28 | +# make sure that the docker dockerlaravelapidev_php_1 or php container is (healthy), |
| 29 | +normally the process begins in starting mode (health: starting), |
43 | 30 | ```
|
44 | | -#### Run the following commands: |
| 31 | +### Production Mode |
| 32 | +* docker-compose-prod.yml: if you are going to use this yaml, make sure to generate the migrations before!, however you can modify the entrypoint to generate them. |
| 33 | + |
| 34 | +## Docker Environments |
45 | 35 |
|
46 | | -##### Compose and Swarm Mode |
| 36 | +### Swarm Mode |
| 37 | +Clone this respository and run the following commands: |
47 | 38 | ```bash
|
48 | | -composer install && cp .env.example .env && php artisan key:generate && php artisan migrate |
49 | | -chmod 755 -R storage |
50 | | -# forward to the port 80, go to localhost and enjoy!... |
| 39 | +cd docker-laravel-api-dev/ |
| 40 | +docker stack deploy -c docker-compose-dev.yml docker-laravel-api-dev |
| 41 | +# wait for the HEALTHCHECK in healthy mode |
51 | 42 | ```
|
52 | | -##### Play With Docker (PWD) |
| 43 | + |
| 44 | +### Docker Compose |
| 45 | +Clone this respository and run the following commands: |
53 | 46 | ```bash
|
54 | | -composer install && php artisan migrate |
55 | | -# forward to the port 80, go to localhost and enjoy!... |
| 47 | +cd docker-laravel-api-dev/ |
| 48 | +docker-compose -f docker-compose-dev.yml up --build -d |
| 49 | +or to see the logs |
| 50 | +docker-compose -f docker-compose-dev.yml up |
| 51 | +# wait for the HEALTHCHECK in healthy mode |
56 | 52 | ```
|
57 | 53 |
|
58 | | -### How to fix Error: laravel.log could not be opened? |
59 | | -In the root directory or inside the container php: |
60 | | -<pre><code>chmod -R 775 storage </code></pre> |
61 | | -* 7 - Owner can write |
62 | | -* 7 - Group can write |
63 | | -* 5 - Others cannot write! |
64 | | -Reference: |
65 | | -https://stackoverflow.com/questions/23411520/how-to-fix-error-laravel-log-could-not-be-opened |
66 | | - |
67 | | -### API Boilerplate Reference |
| 54 | +## API Boilerplate Reference |
68 | 55 | https://github.com/francescomalatesta/laravel-api-boilerplate-jwt/blob/master/readme.md
|
0 commit comments