-
Notifications
You must be signed in to change notification settings - Fork 222
/
Dockerfile
49 lines (35 loc) · 1.28 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
FROM scratch AS composer_install_requirements
COPY composer.json /
FROM scratch AS test_source
COPY benchmarks/ benchmarks/
COPY src/ /src/
COPY tests/ /tests/
COPY phpunit.xml.* phpstan*.neon .php_cs.* phpbench.json /
FROM alpine:3.9
ADD https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub
RUN apk --update add ca-certificates && \
echo "https://dl.bintray.com/php-alpine/v3.9/php-7.4" >> /etc/apk/repositories
# alpine php package does not include default extensions, be explicit
RUN set -eu; \
apk add --no-cache \
php \
php-iconv \
php-json \
php-mbstring \
php-openssl \
php-phar \
php-xml \
php-dom \
php-pdo \
php-curl \
; ln -s /usr/bin/php7 /usr/bin/php
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# install Symfony Flex globally to speed up download of Composer packages (parallelized prefetching)
RUN set -eux; \
composer global require "symfony/flex" --prefer-dist --no-progress --no-suggest --classmap-authoritative;
WORKDIR /opt/test
COPY --from=composer_install_requirements / .
RUN php7 /usr/bin/composer install
COPY --from=test_source / .
RUN echo "memory_limit=1G" > /etc/php7/conf.d/99-custom.ini
ENTRYPOINT ["composer"]