11
11
## Docker Environments
12
12
13
13
### 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
16
18
mkdir .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
+ ```
20
22
### 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
+ ```
24
29
### PWD
25
30
With Play with Docker and following the docker instructions, it is easy to deploy and test this environment!
26
31
@@ -30,7 +35,25 @@ With Play with Docker and following the docker instructions, it is easy to deplo
30
35
31
36
### Execute Laravel Pre-requisites
32
37
In 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
+ ```
34
57
35
58
### How to fix Error: laravel.log could not be opened?
36
59
In the root directory or inside the container php:
0 commit comments