-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
121 lines (108 loc) · 2.73 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
FROM todstoychev/nginx:latest
LABEL description="Docker image with nginx and php 7.1.2 compiled."
LABEL maintainer="[email protected]"
LABEL version="0.1.0"
WORKDIR /root
ADD http://be2.php.net/get/php-7.1.2.tar.gz/from/this/mirror php-7.1.2.tar.gz
RUN tar -xvzf php-7.1.2.tar.gz && rm php-7.1.2.tar.gz
WORKDIR /root/php-7.1.2
RUN apt-get update && apt-get install build-essential \
libfcgi-dev \
libfcgi0ldbl \
libjpeg62-turbo-dbg \
libmcrypt-dev \
libssl-dev \
libc-client2007e \
libc-client2007e-dev \
libxml2-dev \
libbz2-dev \
libcurl4-openssl-dev \
libjpeg-dev \
libpng12-dev \
libfreetype6-dev \
libkrb5-dev \
libpq-dev \
libxml2-dev \
libxslt1-dev \
autoconf \
g++ \
make \
unzip \
wget -y
RUN ln -s /usr/lib/libc-client.a /usr/lib/x86_64-linux-gnu/libc-client.a
# Compile and install php7
RUN ./buildconf --force \
&& ./configure --prefix=/opt/php-7.1 \
--with-pdo-pgsql \
--with-zlib-dir \
--with-freetype-dir \
--enable-mbstring \
--with-libxml-dir=/usr \
--enable-soap \
--enable-calendar \
--with-curl \
--with-mcrypt \
--with-zlib \
--with-gd \
--with-pgsql \
--disable-rpath \
--enable-inline-optimization \
--with-bz2 \
--with-zlib \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-pcntl \
--enable-mbregex \
--enable-exif \
--enable-bcmath \
--with-mhash \
--enable-zip \
--with-pcre-regex \
--with-pdo-mysql \
--with-mysqli \
--with-mysql-sock=/var/run/mysqld/mysqld.sock \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--enable-gd-native-ttf \
--with-openssl \
--with-fpm-user=www-data \
--with-fpm-group=www-data \
--with-libdir=/lib/x86_64-linux-gnu \
--enable-ftp \
--with-imap \
--with-imap-ssl \
--with-kerberos \
--with-gettext \
--with-xmlrpc \
--with-xsl \
--enable-opcache \
--enable-fpm \
&& make \
&& make install clean && \
rm -rf php-7.1.2
RUN ln -s /opt/php-7.1/bin/* /usr/bin && ln -s /opt/php-7.1/sbin/* /usr/sbin
# Install redis extension
WORKDIR /root
RUN wget https://github.com/phpredis/phpredis/archive/php7.zip -O phpredis.zip \
&& unzip -o phpredis.zip \
&& rm phpredis.zip \
&& mv phpredis-* phpredis \
&& cd phpredis \
&& phpize \
&& ./configure \
&& make \
&& make install \
&& rm -rf phpredis
# Uninstall the unecessary stuff
RUN apt-get autoremove -y
ADD resources/php.conf /etc/supervisor/conf.d
ADD resources/default /etc/nginx/sites-available/default
ADD resources/php-fpm.conf /opt/php-7.1/etc/php-fpm.conf
ADD resources/www.conf /opt/php-7.1/etc/php-fpm.d/www.conf
RUN rm -rf /root/php-7.1.2 /root/phpredis
RUN mkdir /var/log/php
WORKDIR /app
RUN echo '<?php phpinfo();' > index.php
EXPOSE 80 443
CMD ["/usr/bin/supervisord"]