-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
95 lines (89 loc) · 3.33 KB
/
Dockerfile
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
FROM php:7.4-cli-alpine
LABEL maintainer="Grégory Planchat <gregory@kiboko.fr>"
ARG APP_UID=1000
ARG APP_GID=1000
ARG APP_USERNAME=docker
ARG APP_GROUPNAME=docker
RUN set -ex\
&& addgroup -g ${APP_GID} ${APP_USERNAME} \
&& adduser -u ${APP_UID} -h /opt/${APP_USERNAME} -H -G ${APP_GROUPNAME} -s /sbin/nologin -D ${APP_USERNAME} \
&& apk update \
&& apk upgrade \
&& apk add \
wget \
ca-certificates \
git \
nodejs \
npm \
docker \
openssh \
&& update-ca-certificates \
&& apk add --virtual .build-deps \
autoconf \
bash \
binutils \
expat \
file \
g++ \
gcc \
m4 \
make \
&& docker-php-ext-install opcache \
&& apk add --update icu-dev icu \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl \
&& docker-php-ext-configure pcntl \
&& docker-php-ext-install pcntl \
&& docker-php-source extract \
&& pecl install xdebug-2.9.0 \
&& docker-php-ext-enable xdebug \
&& docker-php-source delete \
&& apk del icu-dev \
&& apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ --allow-untrusted \
&& apk del \
.build-deps \
gdbm \
gmp \
isl \
libatomic \
libbz2 \
libc-dev \
libffi \
libgomp \
libltdl \
libtool \
mpc1 \
musl-dev \
perl \
pkgconf \
pkgconfig \
python3 \
re2c \
readline \
sqlite-libs \
&& rm -rf /tmp/* /var/cache/apk/* \
&& EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" \
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" \
&& if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then >&2 echo 'ERROR: Invalid installer signature'; rm composer-setup.php; exit 1; fi \
&& php composer-setup.php --install-dir /usr/local/bin --filename composer \
&& php -r "unlink('composer-setup.php');" \
&& curl -LSs https://box-project.github.io/box2/installer.php | php \
&& mv box.phar /usr/local/bin/box \
&& chmod +x /usr/local/bin/box \
&& mkdir -p /opt/docker/.npm \
&& chown docker:docker /opt/docker/.npm
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
ENV current_os=alpine
RUN 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/$current_os/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:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini \
&& curl -A "Docker" -L https://blackfire.io/api/v1/releases/client/linux_static/amd64 | tar zxp -C /tmp/blackfire \
&& mv /tmp/blackfire/blackfire /usr/bin/blackfire \
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
COPY config/memory.ini /usr/local/etc/php/conf.d/memory.ini
COPY config/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
WORKDIR /app