File: Dockerfile

package info (click to toggle)
php-league-commonmark 2.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,536 kB
  • sloc: php: 20,636; xml: 1,998; ruby: 45; makefile: 21; javascript: 15
file content (74 lines) | stat: -rw-r--r-- 2,348 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
FROM php:7.4-cli-alpine

ENV PHPIZE_DEPS \
    autoconf \
    cmake \
    file \
    g++ \
    gcc \
    libc-dev \
    pcre-dev \
    make \
    git \
    pkgconf \
    re2c \
    # for intl extension
    icu-dev \
    # for zip extension
    libzip-dev

RUN apk add --update --no-cache --virtual .persistent-deps \
    # for intl extension
    icu-libs \
    # for mbstring
    oniguruma-dev \
    # for zip
    libzip \
    libgcrypt

# Compile and install extensions
RUN set -xe \
        && apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
        && docker-php-ext-configure intl --enable-intl \
        && docker-php-ext-configure mbstring --enable-mbstring \
        && docker-php-ext-configure opcache --enable-opcache \
        && docker-php-ext-install -j$(nproc) \
            intl \
            mbstring \
            opcache \
            zip \
        && pecl install xdebug-3.1.6 \
        && apk del .build-deps


# Install Blackfire PHP probe
RUN set -xe \
        && 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/alpine/amd64/$version \
        && mkdir -p /tmp/blackfire \
        && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
        && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
        && printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8307\n" > $PHP_INI_DIR/conf.d/blackfire.ini \
        && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz

# Install Blackfire client
RUN set -xe \
        && mkdir -p /tmp/blackfire \
        && curl -A "Docker" -o /tmp/blackfire/blackfire -D - -L -s https://packages.blackfire.io/binaries/blackfire/2.4.3/blackfire-linux_amd64 \
        && mv /tmp/blackfire/blackfire /usr/bin/blackfire \
        && chmod +x /usr/bin/blackfire \
        && rm -Rf /tmp/blackfire

# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer

# Install other needed binaries
RUN apk add --no-cache --update patch git

# Configure PHP
COPY config/php.ini     /usr/local/etc/php/conf.d/
COPY config/opcache.ini /usr/local/etc/php/conf.d/
COPY config/xdebug.ini  /usr/local/etc/php/conf.d/

VOLUME ["/app"]
WORKDIR /app