-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
128 lines (117 loc) · 4.01 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
############################################################
# Dockerfile to build CentOS,Nginx installed Container
# Based on CentOS
############################################################
# Set the base image to Ubuntu
FROM centos:7
ENV nginxversion="1.12.2-1" \
os="centos" \
osversion="7" \
elversion="7_4" \
php_version="7.1.18"
# Installing nginx
RUN yum install -y epel-release; yum install -y wget openssl sed \
&& yum -y autoremove \
&& yum clean all \
&& wget http://nginx.org/packages/$os/$osversion/x86_64/RPMS/nginx-$nginxversion.el$elversion.ngx.x86_64.rpm \
&& rpm -iv nginx-$nginxversion.el$elversion.ngx.x86_64.rpm
# forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
# Installing PHP
RUN yum install -y autoconf libtool bison libxml2-devel bzip2-devel \
libcurl-devel libpng-devel libicu-devel gcc-c++ \
libwebp-devel libjpeg-devel openssl-devel openldap openldap-devel \
libxslt-devel \
libjpeg libpng freetype freetype-devel libxml2 zlib zlib-devel glibc \
glibc-devel glib2 glib2-devel ncurses-devel curl curl-devel \
e2fsprogs krb5-devel libidn libidn-devel automake make enchant-devel \
libXpm-devel libc-client-devel aspell-devel readline-devel net-snmp-devel \
unixODBC-devel libvpx-devel db4-devel gmp-devel sqlite-devel pcre-devel \
mysql-devel libedit-devel libtidy-devel \
&& yum -y autoremove \
&& yum clean all\
&& wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz \
&& tar -zxvf libmcrypt-2.5.7.tar.gz && cd libmcrypt-2.5.7 &&./configure && make && make install \
&& cd .. && rm -rf libmcrypt-2.5.7 \
&& cp -frp /usr/lib64/libldap* /usr/lib/ \
&& wget https://github.com/php/php-src/archive/php-$php_version.tar.gz -O php-$php_version.tar.gz \
&& tar -zxvf php-$php_version.tar.gz
RUN groupadd -f -g 82 www-data && adduser -u 82 -g www-data www-data \
&& export LD_LIBRARY_PATH=/usr/local/mysql/lib:/lib/:/usr/lib/:/usr/local/lib \
&& cd php-src-php-$php_version \
&& ./buildconf --force && ./configure \
--enable-mysqlnd \
--with-mysqli=mysqlnd \
--with-libdir=lib64 \
--with-freetype-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr\
--enable-pdo \
--with-pdo-sqlite \
--with-pdo-mysql=mysqlnd \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--enable-calendar \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--enable-opcache \
--with-ldap \
--with-ldap-sasl \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--with-pear \
--enable-fpm \
--enable-intl \
--with-snmp \
--with-gettext \
--enable-exif \
--with-bz2 \
--enable-sysvmsg \
--enable-sysvshm \
--enable-ftp \
--with-imap \
--with-imap-ssl \
--with-kerberos \
--with-readline \
--with-libedit \
--with-pspell \
--with-tidy \
--with-enchant \
--disable-fileinfo \
--with-xsl \
--enable-embed=shared \
--with-fpm-user=www-data \
--with-fpm-group=www-data \
&& make clean && make && make install && cd .. && rm -rf php-src-php-$php_version
# Installing supervisor
RUN yum install -y python-setuptools
RUN easy_install pip
RUN pip install supervisor
# Adding the configuration file of the nginx
ADD nginx.conf /etc/nginx/nginx.conf
ADD default.conf /etc/nginx/conf.d/default.conf
# Adding the configuration file of the Supervisor
ADD supervisord.conf /etc/
# Adding the default file
ADD index.php /var/www/index.php
ADD php-fpm.conf /etc/php-fpm.conf
# Set the port to 80
EXPOSE 80
# Executing supervisord
CMD ["supervisord", "-n"]