forked from dadeg/docker-compose-nginx-php7-mysql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
78 lines (63 loc) · 2.67 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
#
# million12/nginx-php
#
FROM million12/nginx:latest
MAINTAINER Marcin Ryzycki <[email protected]>
ENV \
STATUS_PAGE_ALLOWED_IP=127.0.0.1
# Add install scripts needed by the next RUN command
ADD container-files/config/install* /config/
# Add files for deploy. i think this will mean the image will be built with all the files in the directory at that time.
# so we do not need to composer install, or add a volume, or anything during a deploy.
# for dev, we can mount a drive to override this.
# ADD ./ /data
RUN \
yum update -y && \
`# Install yum-utils (provides yum-config-manager) + some basic web-related tools...` \
yum install -y yum-utils wget patch mysql tar bzip2 unzip openssh-clients rsync && \
`# Install PHP 7.0 from Remi YUM repository...` \
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm && \
yum install -y \
php70-php \
php70-php-bcmath \
php70-php-cli \
php70-php-common \
php70-php-devel \
php70-php-fpm \
php70-php-gd \
php70-php-gmp \
php70-php-intl \
php70-php-json \
php70-php-mbstring \
php70-php-mcrypt \
php70-php-mysqlnd \
php70-php-opcache \
php70-php-pdo \
php70-php-pear \
php70-php-process \
php70-php-pspell \
php70-php-xml \
`# Also install the following PECL packages:` \
php70-php-pecl-imagick \
php70-php-pecl-mysql \
php70-php-pecl-uploadprogress \
php70-php-pecl-uuid \
php70-php-pecl-zip \
`# Temporary workaround: one dependant package fails to install when building image (and the yum error is: Error unpacking rpm package httpd-2.4.6-40.el7.centos.x86_64)...` \
|| true && \
`# Set PATH so it includes newest PHP and its aliases...` \
ln -sfF /opt/remi/php70/enable /etc/profile.d/php70-paths.sh && \
`# The above will set PATH when container starts... but not when php is used on container build time.` \
`# Therefore create symlinks in /usr/local/bin for all PHP tools...` \
ln -sfF /opt/remi/php70/root/usr/bin/{pear,pecl,phar,php,php-cgi,php-config,phpize} /usr/local/bin/. && \
php --version && \
`# Move PHP config files from /etc/opt/remi/php70/* to /etc/* ` \
mv -f /etc/opt/remi/php70/php.ini /etc/php.ini && ln -s /etc/php.ini /etc/opt/remi/php70/php.ini && \
rm -rf /etc/php.d && mv /etc/opt/remi/php70/php.d /etc/. && ln -s /etc/php.d /etc/opt/remi/php70/php.d && \
echo 'PHP 7 installed.' && \
`# install composer ` \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
chown www /usr/local/bin/composer && composer --version && \
`# Clean YUM caches to minimise Docker image size... #` \
yum clean all && rm -rf /tmp/yum*
ADD container-files /