Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions .lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ services:
appserver:
build:
- composer install
config:
conf: .lando/init/php.ini
build_as_root:
- .lando/init/terminus.sh
- .lando/init/blackfire.sh
run_as_root:
# TODO: This doesn't seem to run at the correct time to ensure that blackfire-agent is running after a service rebuild.
- "/etc/init.d/blackfire-agent restart"
overrides:
environment:
BLACKFIRE_CLIENT_ID:
BLACKFIRE_CLIENT_TOKEN:

node:
type: node
build:
Expand All @@ -35,6 +35,19 @@ services:
services:
image: devwithlando/php:7.3-apache
command: docker-php-entrypoint /app/vendor/bin/mannequin start -c /app/.mannequin.php *:80
blackfire:
type: compose
keys: false
app_mount: false
services:
image: "blackfire/blackfire"
user: root
command: blackfire-agent
environment:
BLACKFIRE_SERVER_ID: # Set in .env if you want to use Blackfire.
BLACKFIRE_SERVER_TOKEN: # Set in .env if you want to use Blackfire.
LANDO_DROP_USER: blackfire

tooling:
gulp:
service: node
Expand Down
28 changes: 0 additions & 28 deletions .lando/config/php.ini

This file was deleted.

27 changes: 7 additions & 20 deletions .lando/init/blackfire.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
#!/usr/bin/env bash
set -e

# Configure Blackfire Repository
wget -q -O - https://packagecloud.io/gpg.key | apt-key add -
echo 'deb http://packages.blackfire.io/debian any main' | tee /etc/apt/sources.list.d/blackfire.list
apt-get update
echo "Installing Blackfire PHP Probe..."
curl -o $(php -r "echo ini_get('extension_dir');")/blackfire.so -L -s https://packages.blackfire.io/binaries/blackfire-php/1.34.0/blackfire-php-linux_amd64-php-$(php -r "echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;").so
printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini

# Install Blackfire Agent
apt-get --yes --force-yes install blackfire-agent
printf "%s\n" $BLACKFIRE_CLIENT_ID $BLACKFIRE_CLIENT_TOKEN | blackfire config

# Install Blackfire Probe
version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;")
curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version
tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp
mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so

# Enable Blackfire Probe
docker-php-ext-enable blackfire

# Start blackfire on-boot
# TODO: this doesn't seem to run at the correct time to ensure that blackfire-agent is running when the service is rebuilt.
/etc/init.d/blackfire-agent restart
echo "Installing Blackfire CLI..."
curl -o /usr/local/bin/blackfire -L -s https://packages.blackfire.io/binaries/blackfire-agent/1.35.1/blackfire-cli-linux_static_amd64
chmod +x /usr/local/bin/blackfire