-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (42 loc) · 1.62 KB
/
Dockerfile
File metadata and controls
54 lines (42 loc) · 1.62 KB
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
FROM scratch AS composer_install_requirements
COPY composer.json /
FROM scratch AS test_source
COPY src/ /src/
COPY tests/ /tests/
COPY phpunit.xml.* phpstan*.neon .php_cs.* /
FROM alpine:3.23
# alpine php package does not include default extensions, be explicit
RUN set -eu; \
apk add --no-cache \
php84 \
php84-iconv \
php84-json \
php84-mbstring \
php84-openssl \
php84-phar \
php84-xml \
php84-dom \
php84-pdo \
php84-curl \
php84-tokenizer \
php84-simplexml \
php84-xmlwriter \
php84-xdebug
# Configure Xdebug
RUN echo "zend_extension=xdebug.so" > /etc/php84/conf.d/50_xdebug.ini; \
echo "xdebug.mode=debug" >> /etc/php84/conf.d/50_xdebug.ini; \
echo "xdebug.start_with_request=yes" >> /etc/php84/conf.d/50_xdebug.ini; \
echo "xdebug.client_host=host.docker.internal" >> /etc/php84/conf.d/50_xdebug.ini; \
echo "xdebug.client_port=9000" >> /etc/php84/conf.d/50_xdebug.ini; \
echo "xdebug.log=/tmp/xdebug.log" >> /etc/php84/conf.d/50_xdebug.ini
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 config --no-plugins allow-plugins.symfony/flex true; \
composer global require "symfony/flex:^1.0" --prefer-dist --no-progress --classmap-authoritative;
WORKDIR /opt/test
COPY --from=composer_install_requirements / .
RUN php /usr/bin/composer install
COPY --from=test_source / .
RUN echo "memory_limit=1G" > /etc/php84/conf.d/99-custom.ini
ENTRYPOINT ["composer"]