|
@@ -1,80 +1,49 @@
|
1
|
|
-#ADD https://www.dotdeb.org/dotdeb.gpg /tmp/dotdeb.gpg
|
2
|
|
-#RUN apt-key add /tmp/dotdeb.gpg
|
3
|
|
-#COPY php7.list /etc/apt/sources.list.d
|
4
|
|
-#
|
5
|
|
-#RUN apt-get update &&\
|
6
|
|
-# apt-get -y install\
|
7
|
|
-# apache2=2.4.*\
|
8
|
|
-# php-pear\
|
9
|
|
-# libapache2-mod-php7.0\
|
10
|
|
-# php7.0\
|
11
|
|
-# php7.0-gd\
|
12
|
|
-# php7.0-curl\
|
13
|
|
-# php7.0-pgsql\
|
14
|
|
-# php7.0-mcrypt\
|
15
|
|
-# php7.0-json &&\
|
16
|
|
-# apt-get clean
|
17
|
|
-#
|
18
|
|
-#COPY apache2.conf /etc/apache2/apache2.conf
|
19
|
|
-#COPY run.sh /run.sh
|
20
|
|
-#
|
21
|
|
-#RUN /usr/sbin/a2enmod rewrite &&\
|
22
|
|
-# ln -sf /dev/stdout /var/log/apache2/access.log &&\
|
23
|
|
-# ln -sf /dev/stderr /var/log/apache2/error.log &&\
|
24
|
|
-# rm -rf /var/www/ &&\
|
25
|
|
-# mkdir -p /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www &&\
|
26
|
|
-# chown -R www-data:www-data /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www &&\
|
27
|
|
-# chmod +x /run.sh
|
28
|
|
-#
|
29
|
|
-#EXPOSE 80
|
30
|
|
-#
|
31
|
|
-#VOLUME ["/var/www"]
|
32
|
|
-#
|
33
|
|
-#CMD ["/run.sh"]
|
34
|
|
-
|
35
|
|
-
|
36
|
|
-
|
37
|
1
|
FROM debian:jessie
|
38
|
2
|
|
39
|
3
|
MAINTAINER Robin Thoni <robin@rthoni.com>
|
40
|
4
|
|
41
|
|
-# persistent / runtime deps
|
|
5
|
+# Build php
|
|
6
|
+# ======================================================================================================================
|
42
|
7
|
ENV PHPIZE_DEPS \
|
43
|
|
- autoconf \
|
44
|
|
- file \
|
45
|
|
- g++ \
|
46
|
|
- gcc \
|
47
|
|
- libc-dev \
|
48
|
|
- make \
|
49
|
|
- pkg-config \
|
50
|
|
- re2c
|
51
|
|
-RUN apt-get update && apt-get install -y \
|
52
|
|
- $PHPIZE_DEPS \
|
53
|
|
- ca-certificates \
|
54
|
|
- curl \
|
55
|
|
- libedit2 \
|
56
|
|
- libsqlite3-0 \
|
57
|
|
- libxml2 \
|
58
|
|
- --no-install-recommends && rm -r /var/lib/apt/lists/*
|
59
|
|
-
|
60
|
|
-ENV PHP_INI_DIR /usr/local/etc/php
|
|
8
|
+ autoconf \
|
|
9
|
+ file \
|
|
10
|
+ g++ \
|
|
11
|
+ gcc \
|
|
12
|
+ libc-dev \
|
|
13
|
+ make \
|
|
14
|
+ pkg-config \
|
|
15
|
+ re2c
|
|
16
|
+RUN apt-get update \
|
|
17
|
+ && apt-get install -y \
|
|
18
|
+ $PHPIZE_DEPS \
|
|
19
|
+ ca-certificates \
|
|
20
|
+ curl \
|
|
21
|
+ libedit2 \
|
|
22
|
+ libsqlite3-0 \
|
|
23
|
+ libxml2 \
|
|
24
|
+ --no-install-recommends \
|
|
25
|
+ && rm -r /var/lib/apt/lists/*
|
|
26
|
+
|
|
27
|
+ENV PHP_INI_DIR /etc/php7.0
|
61
|
28
|
RUN mkdir -p $PHP_INI_DIR/conf.d
|
62
|
29
|
|
63
|
|
-##<autogenerated>##
|
64
|
|
-RUN apt-get update && apt-get install -y apache2-bin apache2.2-common --no-install-recommends && rm -rf /var/lib/apt/lists/*
|
|
30
|
+RUN apt-get update \
|
|
31
|
+ && apt-get install -y apache2-bin apache2.2-common --no-install-recommends \
|
|
32
|
+ && rm -rf /var/lib/apt/lists/*
|
65
|
33
|
|
66
|
|
-RUN rm -rf /var/www/html && mkdir -p /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html && chown -R www-data:www-data /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html
|
|
34
|
+RUN rm -rf /var/www/html \
|
|
35
|
+ && mkdir -p /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html \
|
|
36
|
+ && chown -R www-data:www-data /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html
|
67
|
37
|
|
68
|
|
-# Apache + PHP requires preforking Apache for best results
|
69
|
|
-RUN a2dismod mpm_event && a2enmod mpm_prefork
|
|
38
|
+RUN a2dismod mpm_event \
|
|
39
|
+ && a2enmod mpm_prefork
|
70
|
40
|
|
71
|
|
-RUN mv /etc/apache2/apache2.conf /etc/apache2/apache2.conf.dist && rm /etc/apache2/conf-enabled/* /etc/apache2/sites-enabled/*
|
|
41
|
+RUN mv /etc/apache2/apache2.conf /etc/apache2/apache2.conf.dist \
|
|
42
|
+ && rm /etc/apache2/conf-enabled/* /etc/apache2/sites-enabled/*
|
72
|
43
|
COPY apache2.conf /etc/apache2/apache2.conf
|
73
|
|
-# it'd be nice if we could not COPY apache2.conf until the end of the Dockerfile, but its contents are checked by PHP during compilation
|
74
|
44
|
|
75
|
45
|
ENV PHP_EXTRA_BUILD_DEPS apache2-dev
|
76
|
46
|
ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --enable-maintainer-zts --enable-pthreads
|
77
|
|
-##</autogenerated>##
|
78
|
47
|
|
79
|
48
|
ENV GPG_KEYS 1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763
|
80
|
49
|
|
|
@@ -83,65 +52,86 @@ ENV PHP_FILENAME php-7.0.7.tar.xz
|
83
|
52
|
ENV PHP_SHA256 9cc64a7459242c79c10e79d74feaf5bae3541f604966ceb600c3d2e8f5fe4794
|
84
|
53
|
|
85
|
54
|
RUN set -xe \
|
86
|
|
- && buildDeps=" \
|
87
|
|
- $PHP_EXTRA_BUILD_DEPS \
|
88
|
|
- libcurl4-openssl-dev \
|
89
|
|
- libedit-dev \
|
90
|
|
- libsqlite3-dev \
|
91
|
|
- libssl-dev \
|
92
|
|
- libxml2-dev \
|
93
|
|
- xz-utils \
|
94
|
|
- " \
|
95
|
|
- && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
|
96
|
|
- && curl -fSL "http://php.net/get/$PHP_FILENAME/from/this/mirror" -o "$PHP_FILENAME" \
|
97
|
|
- && echo "$PHP_SHA256 *$PHP_FILENAME" | sha256sum -c - \
|
98
|
|
- && curl -fSL "http://php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o "$PHP_FILENAME.asc" \
|
99
|
|
- && export GNUPGHOME="$(mktemp -d)" \
|
100
|
|
- && for key in $GPG_KEYS; do \
|
101
|
|
- gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
|
102
|
|
- done \
|
103
|
|
- && gpg --batch --verify "$PHP_FILENAME.asc" "$PHP_FILENAME" \
|
104
|
|
- && rm -r "$GNUPGHOME" "$PHP_FILENAME.asc" \
|
105
|
|
- && mkdir -p /usr/src/php \
|
106
|
|
- && tar -xf "$PHP_FILENAME" -C /usr/src/php --strip-components=1 \
|
107
|
|
- && rm "$PHP_FILENAME" \
|
108
|
|
- && cd /usr/src/php \
|
109
|
|
- && ./configure \
|
110
|
|
- --with-config-file-path="$PHP_INI_DIR" \
|
111
|
|
- --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
|
112
|
|
- $PHP_EXTRA_CONFIGURE_ARGS \
|
113
|
|
- --disable-cgi \
|
114
|
|
-# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
|
115
|
|
- --enable-mysqlnd \
|
116
|
|
-# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195)
|
117
|
|
- --enable-mbstring \
|
118
|
|
- --with-curl \
|
119
|
|
- --with-libedit \
|
120
|
|
- --with-openssl \
|
121
|
|
- --with-zlib \
|
122
|
|
- && make -j"$(nproc)" \
|
123
|
|
- && make install \
|
124
|
|
- && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
|
125
|
|
- && make clean \
|
126
|
|
- && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $buildDeps
|
|
55
|
+ && buildDeps=" \
|
|
56
|
+ $PHP_EXTRA_BUILD_DEPS \
|
|
57
|
+ libcurl4-openssl-dev \
|
|
58
|
+ libedit-dev \
|
|
59
|
+ libsqlite3-dev \
|
|
60
|
+ libssl-dev \
|
|
61
|
+ libxml2-dev \
|
|
62
|
+ xz-utils \
|
|
63
|
+ " \
|
|
64
|
+ && apt-get update \
|
|
65
|
+ && apt-get install -y $buildDeps --no-install-recommends \
|
|
66
|
+ && rm -rf /var/lib/apt/lists/* \
|
|
67
|
+ && curl -fSL "http://php.net/get/$PHP_FILENAME/from/this/mirror" -o "$PHP_FILENAME" \
|
|
68
|
+ && echo "$PHP_SHA256 *$PHP_FILENAME" | sha256sum -c - \
|
|
69
|
+ && curl -fSL "http://php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o "$PHP_FILENAME.asc" \
|
|
70
|
+ && export GNUPGHOME="$(mktemp -d)" \
|
|
71
|
+ && for key in $GPG_KEYS; do \
|
|
72
|
+ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
|
|
73
|
+ done \
|
|
74
|
+ && gpg --batch --verify "$PHP_FILENAME.asc" "$PHP_FILENAME" \
|
|
75
|
+ && rm -r "$GNUPGHOME" "$PHP_FILENAME.asc" \
|
|
76
|
+ && mkdir -p /usr/src/php \
|
|
77
|
+ && tar -xf "$PHP_FILENAME" -C /usr/src/php --strip-components=1 \
|
|
78
|
+ && rm "$PHP_FILENAME" \
|
|
79
|
+ && cd /usr/src/php \
|
|
80
|
+ && ./configure \
|
|
81
|
+ --with-config-file-path="$PHP_INI_DIR" \
|
|
82
|
+ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
|
|
83
|
+ $PHP_EXTRA_CONFIGURE_ARGS \
|
|
84
|
+ --disable-cgi \
|
|
85
|
+ --enable-mysqlnd \
|
|
86
|
+ --enable-mbstring \
|
|
87
|
+ --with-curl \
|
|
88
|
+ --with-libedit \
|
|
89
|
+ --with-openssl \
|
|
90
|
+ --with-zlib \
|
|
91
|
+ && make -j"$(nproc)" \
|
|
92
|
+ && make install \
|
|
93
|
+ && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
|
|
94
|
+ && make clean \
|
|
95
|
+ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $buildDeps
|
127
|
96
|
|
128
|
97
|
RUN ln -sf /dev/stdout /var/log/apache2/access.log \
|
129
|
|
- && ln -sf /dev/stderr /var/log/apache2/error.log \
|
130
|
|
- && ln -sf /dev/stdout /var/log/websocket.log \
|
131
|
|
- && ln -sf /dev/stderr /var/log/websocket.err \
|
132
|
|
- && a2enmod rewrite \
|
133
|
|
- && rm -rf /var/www/* \
|
134
|
|
- && chown -R www-data:www-data /var/www
|
|
98
|
+ && ln -sf /dev/stderr /var/log/apache2/error.log \
|
|
99
|
+ && ln -sf /dev/stdout /var/log/websocket.log \
|
|
100
|
+ && ln -sf /dev/stderr /var/log/websocket.err \
|
|
101
|
+ && a2enmod rewrite \
|
|
102
|
+ && rm -rf /var/www/* \
|
|
103
|
+ && chown -R www-data:www-data /var/www
|
|
104
|
+
|
|
105
|
+COPY php-cli.ini "${PHP_INI_DIR}"/
|
|
106
|
+COPY php-apache.ini "${PHP_INI_DIR}"/php-apache2handler.ini
|
135
|
107
|
|
136
|
|
-RUN curl https://getcomposer.org/composer.phar -o /usr/local/bin/composer && chmod +x /usr/local/bin/composer
|
|
108
|
+RUN pecl install pthreads
|
137
|
109
|
|
138
|
|
-RUN apt-get update && apt-get install -y git unzip --no-install-recommends && rm -rf /var/lib/apt/lists/*
|
|
110
|
+# Install Composer
|
|
111
|
+# ======================================================================================================================
|
|
112
|
+RUN curl https://getcomposer.org/composer.phar -o /usr/local/bin/composer \
|
|
113
|
+ && chmod +x /usr/local/bin/composer
|
139
|
114
|
|
140
|
|
-COPY php-cli.ini /etc/php7.0/cli/php.ini
|
|
115
|
+RUN apt-get update \
|
|
116
|
+ && apt-get install -y git unzip --no-install-recommends \
|
|
117
|
+ && rm -rf /var/lib/apt/lists/*
|
141
|
118
|
|
142
|
|
-RUN pecl install pthreads && mkdir -p /etc/php7.0/cli
|
|
119
|
+# Add pdo and db drivers
|
|
120
|
+# ======================================================================================================================
|
|
121
|
+
|
|
122
|
+COPY docker-php-ext-* /usr/local/bin/
|
|
123
|
+
|
|
124
|
+RUN buildDeps="libpq-dev libzip-dev " \
|
|
125
|
+ && apt-get update \
|
|
126
|
+ && apt-get install -y $buildDeps --no-install-recommends \
|
|
127
|
+ && rm -rf /var/lib/apt/lists/* \
|
|
128
|
+ && docker-php-ext-install pdo pdo_pgsql pgsql
|
|
129
|
+
|
|
130
|
+# Run everything
|
|
131
|
+# ======================================================================================================================
|
143
|
132
|
|
144
|
133
|
COPY run.sh /usr/local/bin/
|
|
134
|
+
|
145
|
135
|
WORKDIR /var/www
|
146
|
136
|
|
147
|
137
|
EXPOSE 8180
|