Skip to content

Instantly share code, notes, and snippets.

@pcfreak30
Forked from tylers-username/.env
Last active April 10, 2020 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcfreak30/b14f56bed1093f80c0c6977fc0a0fb3d to your computer and use it in GitHub Desktop.
Save pcfreak30/b14f56bed1093f80c0c6977fc0a0fb3d to your computer and use it in GitHub Desktop.
Install Blackfire on Lando & Automatically Configure
BLACKFIRE_CLIENT_ID=b5ee8ca3-****-****-****-5d227546a4c0
BLACKFIRE_CLIENT_TOKEN=3a2b88cbfb*******************************22763
BLACKFIRE_SERVER_ID=4b8ac335-****-****-****-b34439207732
BLACKFIRE_SERVER_TOKEN=98f7fdf4b12b7**************************12b837cf080d
name: my-php-project
services:
appserver:
type: php:7.0
via: nginx:1.13
ssl: true
webroot: pub
config:
# This provides our Blackfire environment credentials to PHP
conf: php.ini
install_dependencies_as_root:
# Path to blackfireInit.sh
- $LANDO_MOUNT/blackfireInit.sh
run_as_root:
- /etc/init.d/blackfire-agent restart
tooling:
blackfire:
service: appserver
user: root
#!/usr/bin/env bash
# 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
# Install Blackfire Agent
apt-get install blackfire-agent -y --allow-unauthenticated
blackfire config --client-id=$BLACKFIRE_CLIENT_ID --client-token=$BLACKFIRE_CLIENT_TOKEN
# Start blackfire on-boot
/etc/init.d/blackfire-agent restart
# 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
# Blackfire Suggestions
[blackfire]
; Enterprise does not have the option to update Blackfire settings via .platform.app.yaml
; We're giving ourselves auto-update capabilities here
; Sets the socket where the agent is listening.
; Possible value can be a unix socket or a TCP address.
; Defaults to unix:///var/run/blackfire/agent.sock on Linux,
; unix:///usr/local/var/run/blackfire-agent.sock on MacOSX,
; and to tcp://127.0.0.1:8307 on Windows.
; blackfire.agent_socket = unix:///var/run/blackfire/agent.sock
; Log verbosity level (4: debug, 3: info, 2: warning, 1: error)
; blackfire.log_level = 4
; Log file (STDERR by default)
; blackfire.log_file = "${LANDO_MOUNT}"/log/blackfire.log
; Sets fine-grained configuration for Probe.
; This should be left blank in most cases. For most installs,
; the server credentials should only be set in the agent.
blackfire.server_id="${BLACKFIRE_SERVER_ID}"
; Sets fine-grained configuration for Probe.
; This should be left blank in most cases. For most installs,
; the server credentials should only be set in the agent.
blackfire.server_token="${BLACKFIRE_SERVER_TOKEN}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment