Skip to content

Commit 6370612

Browse files
authored
Document how to run api-platform/docker-compose-prod locally (#1014)
1 parent 6a96f69 commit 6370612

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

deployment/docker-compose.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,11 @@ These steps should be performed on the production server.
150150
If you are using the (optional) Let's Encrypt integration:
151151
152152
$ docker-compose -f docker-compose-prod/docker-compose.yml -f docker-compose-prod/docker-compose.letsencrypt.yml up -d
153+
154+
## Running the Docker Compose Setup for Production Locally
155+
156+
Sometimes, you may need to run a production-like setup locally; for example, for [end-to-end testing](../distribution/testing.md#using-the-api-platform-distribution-for-end-to-end-testing)
157+
or to troubleshoot problems which can only be reproduced with a production setup (e.g. Varnish errors or cache misses).
158+
159+
You may (re)use the same [Docker Compose setup for production](https://github.com/api-platform/docker-compose-prod) we
160+
have [installed above](#installing-the-docker-compose-setup-for-production).

distribution/testing.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ To do so, learn how to write unit tests with [PHPUnit](https://phpunit.de/index.
237237
You may also be interested in these alternative testing tools (not included in the API Platform distribution):
238238

239239
* [Behat](http://behat.org/en/latest/) and its [Behatch extension](https://github.com/Behatch/contexts), a
240-
[Behavior-Driven development](https://en.wikipedia.org/wiki/Behavior-driven_development) framework to write the API
240+
[behavior-driven development (BDD)](https://en.wikipedia.org/wiki/Behavior-driven_development) framework to write the API
241241
specification as user stories and in natural language then execute these scenarios against the application to validate
242242
its behavior;
243243
* [Blackfire Player](https://blackfire.io/player), a nice DSL to crawl HTTP services, assert responses, and extract data
@@ -246,3 +246,15 @@ You may also be interested in these alternative testing tools (not included in t
246246
Platform project using a nice UI, benefit from [the Swagger integration](https://www.getpostman.com/docs/importing_swagger)
247247
and run tests in the CI using [newman](https://github.com/postmanlabs/newman);
248248
* [PHP Matcher](https://github.com/coduo/php-matcher), the Swiss Army knife of JSON document testing.
249+
250+
## Using the API Platform Distribution for End-to-end Testing
251+
252+
If you would like to verify that your stack (including services such as the DBMS, web server, [Varnish](https://varnish-cache.org/))
253+
works, you need [end-to-end (E2E) testing](https://wiki.c2.com/?EndToEndPrinciple).
254+
255+
It is also useful to do a [smoke test](https://en.wikipedia.org/wiki/Smoke_testing_(software)) to check that your application
256+
is working; for example, that the application's entrypoint is accessible. This could be used as a quick test after each
257+
Docker build to ensure that the Docker images are not broken.
258+
259+
Usually, this should be done with a production-like setup. For your convenience, you may [run our Docker Compose setup
260+
for production locally](../deployment/docker-compose.md#running-the-docker-compose-setup-for-production-locally).

0 commit comments

Comments
 (0)