-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
87 lines (75 loc) · 1.81 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
FROM php:7.4-fpm-alpine
# Variables
ARG WITH_POSTGRES
ARG WITH_MYSQL
ARG WITH_XML
ARG WITH_XDEBUG
# Do a thing
RUN set -ex
# Add required deps
RUN apk --no-cache add \
g++ \
make \
libtool \
autoconf \
libzip-dev \
icu-dev \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libgomp \
imagemagick \
imagemagick-dev \
git \
jpegoptim \
optipng \
unzip
# Configure GD
RUN docker-php-ext-configure gd \
--with-freetype \
--with-jpeg
# Install PHP extensions
RUN docker-php-ext-install \
gd \
opcache \
pdo \
sockets \
intl \
zip \
bcmath
# Install Imagick
RUN pecl install imagick \
&& docker-php-ext-enable imagick
# Postgres
RUN if [ $WITH_POSTGRES = "true" ] ; then \
apk --no-cache add \
postgresql-dev \
postgresql-client; \
docker-php-ext-install pdo_pgsql; \
fi ;
# MySQL
RUN if [ $WITH_MYSQL = "true" ] ; then \
apk --no-cache add mariadb-client; \
docker-php-ext-install pdo_mysql; \
fi ;
# XML
RUN if [ $WITH_XML = "true" ] ; then \
apk --no-cache add libxslt-dev; \
docker-php-ext-install \
xsl \
soap; \
fi ;
# xdebug
RUN if [ $WITH_XDEBUG = "true" ] ; then \
pecl install xdebug-2.7.0RC2; \
docker-php-ext-enable xdebug; \
echo "error_reporting = E_ALL" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
echo "display_startup_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
echo "display_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
fi ;
# Clean Up
RUN apk del autoconf g++ libtool make \
&& rm -rf /tmp/* /var/cache/apk/*
# Install Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer