-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDockerfile.template
44 lines (33 loc) · 1.27 KB
/
Dockerfile.template
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
ARG PHP_VERSION=7.3.32
FROM php:${PHP_VERSION}-cli
# get apt-get lists for the first time
RUN apt-get update
## install zip extension using debian buster (or higher) repo (which is now available)
## older php:7.3 images are not on buster
## we need zip-1.14 or higher and libzip 1.2 or higher for ZIP encryption support
RUN apt-get update && apt-get install -y zlib1g-dev libzip-dev \
&& pecl install zip
# for PHP <= 7.3 we need to perform this step before installing
RUN if [ "$PHP_VERSION" <= "7.3" ] ; then docker-php-ext-configure zip --with-libzip ; fi
RUN docker-php-ext-install zip
RUN apt-get install -y libgmp-dev
# install some php extensions
RUN docker-php-ext-install gmp bcmath
RUN apt-get install -y git wget
RUN git clone --recursive --depth=1 https://github.com/kjdev/php-ext-snappy.git \
&& cd php-ext-snappy \
&& phpize \
&& ./configure \
&& make \
&& make install \
&& docker-php-ext-enable snappy
# install composer
RUN curl -sS https://getcomposer.org/installer | \
php -- --install-dir=/usr/bin/ --filename=composer
# include the files in the docker image
COPY . /usr/src/app
WORKDIR /usr/src/app
# run composer installation
RUN composer self-update && composer update --ignore-platform-reqs
ENTRYPOINT [ "vendor/bin/phpunit" ]
CMD [ "tests" ]