forked from million12/docker-nginx-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
88 lines (67 loc) · 3.19 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
88
FROM million12/nginx:latest
MAINTAINER Marcin Ryzycki <[email protected]>
# Add install scripts needed by the next RUN command
ADD container-files/config/install* /config/
RUN \
rpm --rebuilddb && 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-horde-horde-lz4 \
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 \
`# Also install the following PECL packages:` \
php70-php-pecl-imagick \
php70-php-pecl-memcached \
php70-php-pecl-redis \
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 libs required to build some gem/npm packages (e.g. PhantomJS requires zlib-devel, libpng-devel)` \
yum install -y ImageMagick GraphicsMagick gcc gcc-c++ libffi-devel libpng-devel zlib-devel && \
`# Install common tools needed/useful during Web App development` \
`# Install Ruby 2` \
yum install -y ruby ruby-devel && \
`# Install/compile other software (Git, NodeJS)` \
source /config/install.sh && \
yum clean all && rm -rf /tmp/yum* && \
`# Install common npm packages: grunt, gulp, bower, browser-sync` \
npm install -g gulp grunt-cli bower browser-sync && \
`# Update RubyGems, install Bundler` \
echo 'gem: --no-document' > /etc/gemrc && gem update --system && gem install bundler && \
`# Disable SSH strict host key checking: needed to access git via SSH in non-interactive mode` \
echo -e "StrictHostKeyChecking no" >> /etc/ssh/ssh_config && \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
chown www /usr/local/bin/composer && composer --version
ADD container-files /
ENV STATUS_PAGE_ALLOWED_IP=127.0.0.1