forked from arvatoSCM/dockerize-magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
92 lines (82 loc) · 2.13 KB
/
Copy pathDockerfile
File metadata and controls
92 lines (82 loc) · 2.13 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
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
88
89
90
91
92
FROM php:7.3-fpm
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --enable-intl --enable-opcache --enable-zip
RUN apt-get update
RUN \
apt-get install -y \
libcurl4-gnutls-dev \
libxml2-dev \
libssl-dev
RUN \
/usr/local/bin/docker-php-ext-install \
dom \
pcntl \
phar \
posix
# Configure PHP
# php module build deps
RUN \
apt-get install -y \
cron \
git \
gzip \
libbz2-dev \
libfreetype6-dev \
libicu-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
libsodium-dev \
libssh2-1-dev \
libxslt1-dev \
libzip-dev \
lsof \
default-mysql-client \
vim \
zip \
libonig-dev
# http://devdocs.magento.com/guides/v2.0/install-gde/system-requirements.html
RUN \
/usr/local/bin/docker-php-ext-install \
bcmath \
bz2 \
calendar \
exif \
gd \
gettext \
intl \
mbstring \
mysqli \
opcache \
pcntl \
pdo_mysql \
soap \
sockets \
sodium \
sysvmsg \
sysvsem \
sysvshm \
xsl \
zip
# Make sure the volume mount point is empty
RUN rm -rf /var/www/html/*
# Set www-data as owner for /var/www
RUN chown -R www-data:www-data /var/www/
RUN chmod -R g+w /var/www/
# Create log folders
RUN mkdir /var/log/php-fpm && \
touch /var/log/php-fpm/access.log && \
touch /var/log/php-fpm/error.log && \
chown -R www-data:www-data /var/log/php-fpm
# enabling gd extension
# from PHP docs:
# To enable support for FreeType 2 add --with-freetype-dir=DIR .
# As of PHP 7.4.0 use --with-freetype instead, which relies on pkg-config.
RUN docker-php-ext-configure gd --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr \
&& docker-php-ext-install gd
# Install xdebug
RUN cd /tmp/ && git clone https://github.com/xdebug/xdebug.git \
&& cd xdebug && phpize && ./configure --enable-xdebug && make \
&& mkdir /usr/lib/php7/ && cp modules/xdebug.so /usr/lib/php7/xdebug.so \
&& touch /usr/local/etc/php/ext-xdebug.ini \
&& rm -r /tmp/xdebug \
&& apt-get purge -y --auto-remove