-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Many MacOS users may be facing slow responses from Shop or Admin when running the sylius application in the container. The main reason is how docker was build in the MacOS architecture. The PHP application has thousands of files to be loaded in memory (vendor directory mainly). So, to decrease the page response time, the vendor directory is not synced into the container. It will be ignored by docker-composer.yml using the named volume. Also, was added a health check for the PHP-fpm container to know when it is ready. If you want to check healthiness, just run the command `docker-compose ps` to see the container State. The HEALTHCHECK instruction tells Docker how to test a container to check that it is still working. This can detect cases such as a web server stuck in an infinite loop and unable to handle new connections, even though the server process is still running. The PHP and PHP-FPM configurations received some adjustments to get better support development environment experience using containers. I did pick up these updates from two other contributors that I co-authored in this commit. Co-authored-by: Kévin Dunglas <[email protected]> Co-authored-by: arti0090 <[email protected]>
- Loading branch information
1 parent
1a8f97a
commit a786874
Showing
9 changed files
with
148 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
export SCRIPT_NAME=/ping | ||
export SCRIPT_FILENAME=/ping | ||
export REQUEST_METHOD=GET | ||
|
||
if cgi-fcgi -bind -connect 127.0.0.1:9000; then | ||
exit 0 | ||
fi | ||
|
||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[global] | ||
error_log = /proc/self/fd/2 | ||
log_buffering = yes | ||
log_level = notice | ||
|
||
[www] | ||
user = www-data | ||
group = www-data | ||
listen = 9000 | ||
; check how to tuning you php-fpm | ||
; https://tideways.com/profiler/blog/an-introduction-to-php-fpm-tuning | ||
; | ||
; | Setting | Value | | ||
; | max_children | (Total RAM – Memory used for Linux, DB, etc.) / process size | | ||
; | start_servers | Number of CPU cores x 4 | | ||
; | min_spare_servers | Number of CPU cores x 2 | | ||
; | max_spare_servers | Same as start_servers | | ||
|
||
pm = dynamic | ||
pm.max_children = 16 | ||
pm.start_servers = 16 | ||
pm.min_spare_servers = 8 | ||
pm.max_spare_servers = 16 | ||
pm.max_requests = 200 | ||
pm.status_path = /status | ||
|
||
ping.path = /ping | ||
ping.response = pong |