Skip to content

Commit

Permalink
Merge pull request #174 from reload/blackfire-documentation
Browse files Browse the repository at this point in the history
Add Blackfire setup documentation
  • Loading branch information
arnested authored Oct 5, 2023
2 parents 889c652 + 29a8f54 commit b46f6cd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,29 @@ typing enter.

## Blackfire

@todo
In order to send profiles to Blackfire, you'll need to have a
Blackfire agent reachable by the php-fpm image and the appropriate
credentials.

Providing an agent in docker compose is easy, as it's just starting
the orignial Blackfire image.

``` yaml
php:
image: 'ghcr.io/reload/php-fpm:8.2'
environment:
BLACKFIRE_CLIENT_ID: <your client key>
BLACKFIRE_CLIENT_TOKEN: <your client token>
blackfire:
image: blackfire/blackfire
environment:
BLACKFIRE_SERVER_ID: <your server key>
BLACKFIRE_SERVER_TOKEN: <your server token>
```

The correct id's and tokens can be found by viewing the [Blackfire
setup documentation](https://blackfire.io/docs/php/configuration) when
logged in.

## Mail

Expand Down
4 changes: 2 additions & 2 deletions context/etc/entrypoint.d/blackfire.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
# Ensure Blackfire is only enabled if we have the necessary configuration.
set -e

if [ -n "${BLACKFIRE_SOCKET}" ]; then
docker-php-ext-enable-blackfire
if [ -n "${BLACKFIRE_CLIENT_ID}" ] && [ -n "${BLACKFIRE_CLIENT_TOKEN}" ]; then
sudo docker-php-ext-enable-blackfire
fi

0 comments on commit b46f6cd

Please sign in to comment.