This repository has been archived by the owner on Feb 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
83 lines (70 loc) · 2.43 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
FROM php:7.3-cli-alpine
RUN apk update && apk upgrade \
&& set -xe \
&& apk add --no-cache --virtual .build-deps \
icu-dev \
zlib-dev \
icu-libs \
g++ \
make \
autoconf \
libxslt-dev \
zlib \
wget \
curl \
libtool \
libcurl \
openssl-dev \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libzip-dev \
&& apk add --no-cache git unzip icu freetype libzip libpng libjpeg-turbo \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install gd \
bcmath \
intl \
zip \
pdo_mysql \
opcache \
soap \
sockets \
iconv \
&& pecl install xdebug redis \
&& docker-php-ext-enable redis \
&& apk del --purge .build-deps \
&& rm -rf /tmp/pear ~/.pearrc /var/tmp/* /tmp/*
RUN { \
echo '#!/bin/sh'; \
echo '/usr/local/bin/php -dzend_extension=xdebug.so "$@"'; \
} > /usr/local/bin/php-xdebug \
&& chmod +x /usr/local/bin/php-xdebug
COPY --from=composer:2.2 /usr/bin/composer /usr/bin/composer
RUN composer global require \
phpmd/phpmd \
pdepend/pdepend \
phpstan/phpstan \
phpstan/phpstan-doctrine \
phpstan/phpstan-phpunit \
phpstan/phpstan-symfony \
--prefer-dist --no-interaction \
&& rm -rf /root/.composer/cache/*
RUN wget -c https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -O /usr/local/bin/phpcs \
&& chmod a+x /usr/local/bin/phpcs
RUN wget -c https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar -O /usr/local/bin/phpcbf \
&& chmod a+x /usr/local/bin/phpcbf
RUN mkdir -p /usr/local/etc/phpcs \
&& git clone git://github.com/escapestudios/Symfony2-coding-standard.git /usr/local/etc/phpcs/Symfony2-coding-standard \
&& /usr/local/bin/phpcs --config-set installed_paths /usr/local/etc/phpcs/Symfony2-coding-standard
RUN wget -c https://phar.phpunit.de/phpcpd.phar -O /usr/local/bin/phpcpd \
&& chmod a+x /usr/local/bin/phpcpd
RUN wget -c https://phar.phpunit.de/phploc.phar -O /usr/local/bin/phploc \
&& chmod a+x /usr/local/bin/phploc
RUN wget -c https://cs.symfony.com/download/php-cs-fixer-v2.phar -O /usr/local/bin/php-cs-fixer \
&& chmod a+x /usr/local/bin/php-cs-fixer
RUN cp "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
&& sed -i "s/memory_limit\s*=.*/memory_limit=-1/g" "$PHP_INI_DIR/php.ini"
ENV PATH="$PATH:/root/.composer/vendor/bin"
WORKDIR /app