File tree Expand file tree Collapse file tree 16 files changed +132
-3
lines changed Expand file tree Collapse file tree 16 files changed +132
-3
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ upstream fastcgi_backend {
5
5
server {
6
6
listen 80;
7
7
listen 443 ssl;
8
+
9
+ fastcgi_buffers 16 16k;
10
+ fastcgi_buffer_size 32k;
8
11
9
12
server_name _;
10
13
Original file line number Diff line number Diff line change @@ -124,6 +124,13 @@ RUN pecl install -o -f \
124
124
xdebug-2.6.1 \
125
125
yaml
126
126
127
+ RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;" ) \
128
+ && mkdir -p /tmp/blackfire \
129
+ && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
130
+ && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');" )/blackfire.so \
131
+ && ( echo extension=blackfire.so \
132
+ && echo blackfire.agent_socket=tcp://blackfire:8707 ) > $(php -i | grep "additional .ini" | awk '{print $9}' )/blackfire.ini \
133
+ && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
127
134
RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
128
135
&& rm -f /usr/local/lib/php/extensions/*/*sodium.so \
129
136
&& apt-get remove libsodium* -y \
@@ -147,6 +154,7 @@ RUN cd /tmp \
147
154
148
155
RUN docker-php-ext-enable \
149
156
bcmath \
157
+ blackfire \
150
158
bz2 \
151
159
calendar \
152
160
exif \
Original file line number Diff line number Diff line change @@ -102,6 +102,13 @@ RUN pecl install -o -f \
102
102
xdebug-2.6.1 \
103
103
yaml
104
104
105
+ RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;" ) \
106
+ && mkdir -p /tmp/blackfire \
107
+ && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
108
+ && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');" )/blackfire.so \
109
+ && ( echo extension=blackfire.so \
110
+ && echo blackfire.agent_socket=tcp://blackfire:8707 ) > $(php -i | grep "additional .ini" | awk '{print $9}' )/blackfire.ini \
111
+ && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
105
112
RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
106
113
&& rm -f /usr/local/lib/php/extensions/*/*sodium.so \
107
114
&& apt-get remove libsodium* -y \
@@ -125,6 +132,7 @@ RUN cd /tmp \
125
132
126
133
RUN docker-php-ext-enable \
127
134
bcmath \
135
+ blackfire \
128
136
bz2 \
129
137
calendar \
130
138
exif \
Original file line number Diff line number Diff line change @@ -121,6 +121,13 @@ RUN pecl install -o -f \
121
121
xdebug-2.7.1 \
122
122
yaml
123
123
124
+ RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;" ) \
125
+ && mkdir -p /tmp/blackfire \
126
+ && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
127
+ && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');" )/blackfire.so \
128
+ && ( echo extension=blackfire.so \
129
+ && echo blackfire.agent_socket=tcp://blackfire:8707 ) > $(php -i | grep "additional .ini" | awk '{print $9}' )/blackfire.ini \
130
+ && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
124
131
RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
125
132
&& rm -f /usr/local/lib/php/extensions/*/*sodium.so \
126
133
&& apt-get remove libsodium* -y \
@@ -144,6 +151,7 @@ RUN cd /tmp \
144
151
145
152
RUN docker-php-ext-enable \
146
153
bcmath \
154
+ blackfire \
147
155
bz2 \
148
156
calendar \
149
157
exif \
Original file line number Diff line number Diff line change @@ -99,6 +99,13 @@ RUN pecl install -o -f \
99
99
xdebug-2.7.1 \
100
100
yaml
101
101
102
+ RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;" ) \
103
+ && mkdir -p /tmp/blackfire \
104
+ && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
105
+ && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');" )/blackfire.so \
106
+ && ( echo extension=blackfire.so \
107
+ && echo blackfire.agent_socket=tcp://blackfire:8707 ) > $(php -i | grep "additional .ini" | awk '{print $9}' )/blackfire.ini \
108
+ && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
102
109
RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
103
110
&& rm -f /usr/local/lib/php/extensions/*/*sodium.so \
104
111
&& apt-get remove libsodium* -y \
@@ -122,6 +129,7 @@ RUN cd /tmp \
122
129
123
130
RUN docker-php-ext-enable \
124
131
bcmath \
132
+ blackfire \
125
133
bz2 \
126
134
calendar \
127
135
exif \
Original file line number Diff line number Diff line change 2
2
FROM php:7.4-cli-buster
3
3
ARG GOSU_VERSION=1.11
4
4
5
+ ENV COMPOSER_MEMORY_LIMIT -1
5
6
ENV PHP_MEMORY_LIMIT 2G
6
7
ENV MAGENTO_ROOT /app
7
8
ENV DEBUG false
@@ -110,6 +111,13 @@ RUN pecl install -o -f \
110
111
xdebug-2.9.3 \
111
112
yaml
112
113
114
+ RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;" ) \
115
+ && mkdir -p /tmp/blackfire \
116
+ && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
117
+ && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');" )/blackfire.so \
118
+ && ( echo extension=blackfire.so \
119
+ && echo blackfire.agent_socket=tcp://blackfire:8707 ) > $(php -i | grep "additional .ini" | awk '{print $9}' )/blackfire.ini \
120
+ && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
113
121
RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
114
122
&& rm -f /usr/local/lib/php/extensions/*/*sodium.so \
115
123
&& apt-get remove libsodium* -y \
@@ -125,6 +133,7 @@ RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
125
133
126
134
RUN docker-php-ext-enable \
127
135
bcmath \
136
+ blackfire \
128
137
bz2 \
129
138
calendar \
130
139
exif \
Original file line number Diff line number Diff line change @@ -89,6 +89,13 @@ RUN pecl install -o -f \
89
89
xdebug-2.9.3 \
90
90
yaml
91
91
92
+ RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;" ) \
93
+ && mkdir -p /tmp/blackfire \
94
+ && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
95
+ && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');" )/blackfire.so \
96
+ && ( echo extension=blackfire.so \
97
+ && echo blackfire.agent_socket=tcp://blackfire:8707 ) > $(php -i | grep "additional .ini" | awk '{print $9}' )/blackfire.ini \
98
+ && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
92
99
RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
93
100
&& rm -f /usr/local/lib/php/extensions/*/*sodium.so \
94
101
&& apt-get remove libsodium* -y \
@@ -104,6 +111,7 @@ RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
104
111
105
112
RUN docker-php-ext-enable \
106
113
bcmath \
114
+ blackfire \
107
115
bz2 \
108
116
calendar \
109
117
exif \
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ class ExtensionResolver
85
85
/**
86
86
* Extensions which should be ignored
87
87
*/
88
- private const IGNORED_EXTENSIONS = ['blackfire ' , ' newrelic ' ];
88
+ private const IGNORED_EXTENSIONS = ['newrelic ' ];
89
89
90
90
/**
91
91
* @var Semver
@@ -163,6 +163,22 @@ public static function getConfig(): array
163
163
'bcmath ' => [
164
164
'>=7.0 ' => [self ::EXTENSION_TYPE => self ::EXTENSION_TYPE_CORE ],
165
165
],
166
+ 'blackfire ' => [
167
+ '>=7.2 ' => [
168
+ self ::EXTENSION_TYPE => self ::EXTENSION_TYPE_INSTALLATION_SCRIPT ,
169
+ // phpcs:disable
170
+ self ::EXTENSION_INSTALLATION_SCRIPT => <<< BASH
171
+ curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;")
172
+ mkdir -p /tmp/blackfire
173
+ tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire
174
+ mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so
175
+ ( echo extension=blackfire.so
176
+ echo blackfire.agent_socket=tcp://blackfire:8707 ) > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini
177
+ rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
178
+ BASH
179
+ // phpcs:enable
180
+ ]
181
+ ],
166
182
'bz2 ' => [
167
183
'>=7.0 ' => [
168
184
self ::EXTENSION_TYPE => self ::EXTENSION_TYPE_CORE ,
Original file line number Diff line number Diff line change @@ -354,6 +354,27 @@ public function build(Config $config): Manager
354
354
);
355
355
}
356
356
357
+ if ($ config ->hasServiceEnabled (ServiceInterface::SERVICE_BLACKFIRE )) {
358
+ $ manager ->addService (
359
+ ServiceInterface::SERVICE_BLACKFIRE ,
360
+ $ this ->serviceFactory ->create (
361
+ ServiceInterface::SERVICE_BLACKFIRE ,
362
+ $ config ->getServiceVersion (ServiceInterface::SERVICE_BLACKFIRE ),
363
+ [
364
+ 'environment ' => [
365
+ 'BLACKFIRE_SERVER_ID ' => $ config ->getBlackfireConfig ()['server_id ' ],
366
+ 'BLACKFIRE_SERVER_TOKEN ' => $ config ->getBlackfireConfig ()['server_token ' ],
367
+ 'BLACKFIRE_CLIENT_ID ' => $ config ->getBlackfireConfig ()['client_id ' ],
368
+ 'BLACKFIRE_CLIENT_TOKEN ' => $ config ->getBlackfireConfig ()['client_token ' ]
369
+ ],
370
+ 'ports ' => ["8707 " ]
371
+ ]
372
+ ),
373
+ [self ::NETWORK_MAGENTO ],
374
+ []
375
+ );
376
+ }
377
+
357
378
$ phpExtensions = $ this ->phpExtension ->get ($ config );
358
379
359
380
/**
Original file line number Diff line number Diff line change @@ -248,6 +248,15 @@ public function hasTmpMounts(): bool
248
248
return (bool )$ this ->all ()->get (SourceInterface::SYSTEM_TMP_MOUNTS );
249
249
}
250
250
251
+ /**
252
+ * @return array
253
+ * @throws ConfigurationMismatchException
254
+ */
255
+ public function getBlackfireConfig (): array
256
+ {
257
+ return (array )$ this ->all ()->get (SourceInterface::SERVICES_BLACKFIRE_CONFIG , []);
258
+ }
259
+
251
260
/**
252
261
* @return string|null
253
262
* @throws ConfigurationMismatchException
You can’t perform that action at this time.
0 commit comments