Skip to content

Commit f6d5ba6

Browse files
committed
Update the Docker configuration
1 parent d3f9107 commit f6d5ba6

File tree

4 files changed

+23
-11
lines changed

4 files changed

+23
-11
lines changed

deployment/docker.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,26 @@ API Platform projects can be run through [Docker](https://www.docker.com/).
44
A [Docker compose](https://docs.docker.com/compose/) configuration including a fully working [LAMP](https://en.wikipedia.org/wiki/LAMP_(software_bundle))
55
stack is shipped with the API Platform distribution.
66

7+
## Services
8+
9+
The Docker Compose configuration comes with several ready-use services by default:
10+
11+
| Name | Description | Port(s)
12+
| ------- | ------------------------------------------------------------- | -------
13+
| app | The application with PHP and PHP-FPM 7.1, the latest Composer | N/A
14+
| db | A database provided by MySQL 5.7 | N/A
15+
| nginx | An HTTP server provided by Nginx 1.11 | 8080
16+
| varnish | An HTTP cache provided by Varnish 4.1 | 80
17+
18+
## Installation
19+
720
To install it, run the following commands (Docker must be installed on your system):
821

922
$ docker-compose up -d # Download, build and run Docker images
1023
$ docker-compose exec app bin/console doctrine:schema:create # Create the MySQL schema
1124

12-
Your project will be accessible at the URL `http://127.0.0.1`.
25+
Your project will be accessible in two different ways:
26+
* Through the HTTP cache (Varnish): `http://localhost`
27+
* Through the HTTP server directly (Nginx) to facilitate debugging: `http://localhost:8080`
1328

1429
Previous chapter: [Deploying an API Platform App on Heroku](heroku.md)

distribution/index.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,9 @@ Instead of using Docker, API Platform can also be installed on the local machine
9696
Then, enter the project folder, create the database and its schema:
9797

9898
$ cd bookshop-api
99-
$ bin/console doctrine:database:create
100-
$ bin/console doctrine:schema:create
101-
102-
And start the server:
103-
104-
$ bin/console server:run
99+
$ docker-compose up -d
100+
$ docker-compose exec app bin/console doctrine:database:create
101+
$ docker-compose exec app bin/console doctrine:schema:create
105102

106103
## It's ready!
107104

distribution/testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ The API Platform flavor of Behat also comes with a temporary SQLite database ded
160160

161161
Clear the cache of the `test` environment:
162162

163-
$ docker-compose app bin/console cache:clear --env=test
163+
$ docker-compose exec app bin/console cache:clear --env=test
164164

165165
Then run:
166166

167-
$ docker-compose run --rm app vendor/bin/behat
167+
$ docker-compose exec app vendor/bin/behat
168168

169169
Everything should be green now. Your Linked Data API is now specified and tested thanks to Behat!
170170

schema-generator/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ types:
5353
5454
Run the generator with this config file as parameter:
5555
56-
$ docker-compose exec app vendor/bin/schema generate-types src/ app/config/schema.yml
56+
$ vendor/bin/schema generate-types src/ app/config/schema.yml
5757
5858
The following classes will be generated:
5959
@@ -745,7 +745,7 @@ When cardinality cannot be automatically extracted, it's value is set to `unknow
745745

746746
Usage:
747747

748-
$ docker-compose exec app vendor/bin/schema extract-cardinalities
748+
$ vendor/bin/schema extract-cardinalities
749749

750750
Previous chapter: [Introduction](index.md)
751751

0 commit comments

Comments
 (0)