1111## Docker Environments
1212
1313### Swarm Mode
14- In the root directory and following the Docker instructions:
15- <pre ><code ># Creating mount folder
14+ Clone this respository and run the following commands:
15+ ``` bash
16+ cd docker-laravel-api-dev/
17+ # Creating mount folder
1618mkdir .docker/local-mysql-datadir
17- docker stack deploy -c docker-compose.yml api -laravel-docker
18- </ code ></ pre >
19-
19+ docker stack deploy -c docker-compose.yml docker -laravel-api-dev
20+ # wait for it and follow the docker instructions!...
21+ ```
2022### Docker Compose
21- In the root directory:
22- <pre ><code >docker-compose -f docker-compose.yml up --build -d</code ></pre >
23-
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+ ```
2429### PWD
2530With Play with Docker and following the docker instructions, it is easy to deploy and test this environment!
2631
@@ -30,7 +35,25 @@ With Play with Docker and following the docker instructions, it is easy to deplo
3035
3136### Execute Laravel Pre-requisites
3237In the root directory:
33- <pre ><code >docker container exec [dockerlaravelapidev_php_1 or container Id] composer install && cp.env.example .env && php artisan key:generate && php artisan migrate</code ></pre >
38+ ``` bash
39+ # container lists
40+ 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
43+ ```
44+ #### Run the following commands:
45+
46+ ##### Compose and Swarm Mode
47+ ``` 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!...
51+ ```
52+ ##### Play With Docker (PWD)
53+ ``` bash
54+ composer install && php artisan migrate
55+ # forward to the port 80, go to localhost and enjoy!...
56+ ```
3457
3558### How to fix Error: laravel.log could not be opened?
3659In the root directory or inside the container php:
0 commit comments