Skip to content

Instantly share code, notes, and snippets.

@kraynel
Last active June 12, 2020 12:52
Show Gist options
  • Select an option

  • Save kraynel/f1bc7c9f386a8fe11c266eabe580e6a3 to your computer and use it in GitHub Desktop.

Select an option

Save kraynel/f1bc7c9f386a8fe11c266eabe580e6a3 to your computer and use it in GitHub Desktop.
services:
php:
build:
context: ./api
target: api_platform_php
<<: *api-cache-from
image: ${PHP_IMAGE:-quay.io/api-platform/php}
healthcheck:
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
environment:
- DD_AGENT_HOST=jaeger
- DD_AGENT_PORT=6831
- DD_TRACE_AGENT_PORT=6831
- DD_TRACE_DEBUG=true
- DD_SERVICE_NAME=symfony-test
- DD_TRACE_ENCODER=jaeger
- DD_TRACE_GLOBAL_TAGS=env:dev
depends_on:
- db
- jaeger
...
jaeger:
image: jaegertracing/all-in-one:1.18
environment:
- LOG_LEVEL=debug
ports:
- target: 16686
published: 16686
protocol: tcp
RUN docker-php-ext-install -j$(nproc) \
intl \
pdo_pgsql \
zip \
sockets;
RUN set -eux \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
icu-dev \
libzip-dev \
curl-dev \
&& git clone --single-branch --branch add-jaeger-rebased https://github.com/kraynel/dd-trace-php.git /etc/dd-trace-php \
&& cd /etc/dd-trace-php \
&& phpize \
&& ./configure --enable-ddtrace \
&& make \
&& make install \
&& docker-php-ext-enable --ini-name 98-ddtrace.ini ddtrace \
&& echo 'ddtrace.request_init_hook=/etc/dd-trace-php/bridge/dd_wrap_autoloader.php' >> /usr/local/etc/php/conf.d/98-ddtrace.ini \
&& runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"
RUN cd /etc/dd-trace-php && composer install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment