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