Skip to content

Commit b92aaa5

Browse files
committed
Use Debian testing and fix running PHP7
1 parent a1ff286 commit b92aaa5

3 files changed

Lines changed: 42 additions & 26 deletions

File tree

Dockerfile

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,38 @@
1-
FROM php:7-fpm
1+
FROM debian:testing
22

3-
RUN apt-get update && apt-get install -y mysql-client nginx libpng12-dev libjpeg-dev && rm -rf /var/lib/apt/lists/* \
4-
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
5-
&& docker-php-ext-install gd mysqli pdo pdo_mysql opcache
3+
RUN apt-get update && apt-get install -y mysql-client nginx && rm -rf /var/lib/apt/lists/*
4+
5+
# PHP
6+
RUN apt-get update && \
7+
apt-get -y install \
8+
php7.0 \
9+
php7.0-cgi \
10+
php7.0-cli \
11+
php7.0-common \
12+
php7.0-curl \
13+
php7.0-dev \
14+
php7.0-gd \
15+
php7.0-gmp \
16+
php7.0-json \
17+
php7.0-ldap \
18+
php7.0-mysql \
19+
php7.0-odbc \
20+
php7.0-opcache \
21+
php7.0-pspell \
22+
php7.0-readline \
23+
php7.0-sqlite3 \
24+
php7.0-tidy \
25+
php7.0-xmlrpc \
26+
php7.0-xsl \
27+
php7.0-fpm \
28+
php7.0-intl \
29+
php7.0-mcrypt && apt-get clean
30+
31+
RUN mkdir /run/php
632

733
# nginx site conf
834
ADD ./nginx-site.conf /etc/nginx/sites-available/default
9-
#RUN sed -i "s/nginx;/www-data;/" /etc/nginx/nginx.conf
10-
11-
# set recommended PHP.ini settings
12-
# see https://secure.php.net/manual/en/opcache.installation.php
13-
RUN { \
14-
echo 'opcache.memory_consumption=128'; \
15-
echo 'opcache.interned_strings_buffer=8'; \
16-
echo 'opcache.max_accelerated_files=4000'; \
17-
echo 'opcache.revalidate_freq=60'; \
18-
echo 'opcache.fast_shutdown=1'; \
19-
echo 'opcache.enable_cli=1'; \
20-
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
35+
RUN sed -i "s/nginx;/www-data;/" /etc/nginx/nginx.conf
2136

2237
# Install WP-CLI
2338
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
@@ -43,11 +58,8 @@ COPY docker-entrypoint.sh /entrypoint.sh
4358
# grr, ENTRYPOINT resets CMD now
4459
ENTRYPOINT ["/entrypoint.sh"]
4560

46-
RUN mkdir /usr/src/wordpress
47-
RUN chown -R www-data:www-data /usr/src/wordpress
4861
WORKDIR /usr/src/wordpress
4962
VOLUME ['/usr/src/wordpress/wp-content']
5063

5164
EXPOSE 80
52-
CMD ["php-fpm"]
5365
CMD ["nginx", "-g", "daemon off;"]

docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -e
33

44
: "${WORDPRESS_TITLE:=WordPress site}"
5-
: "${WORDPRESS_URL:=http://localhost}"
5+
: "${WORDPRESS_URL:=http://localhost:8080}"
66

77
: "${WORDPRESS_VERSION:=latest}"
88
: "${WORDPRESS_DB_PREFIX:=wp_}"

nginx-site.conf

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,17 @@ server {
3030
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
3131
#
3232
location ~ \.php$ {
33-
try_files $uri =404;
34-
fastcgi_split_path_info ^(.+\.php)(/.+)$;
35-
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
33+
include snippets/fastcgi-php.conf;
3634

37-
fastcgi_pass localhost:9000;
38-
fastcgi_index index.php;
39-
include fastcgi_params;
35+
fastcgi_buffer_size 128k;
36+
fastcgi_buffers 256 256k;
37+
fastcgi_busy_buffers_size 256k;
38+
fastcgi_temp_file_write_size 256k;
39+
40+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
41+
fastcgi_param REMOTE_ADDR $http_x_real_ip;
42+
43+
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
4044
}
4145

4246
# deny access to all files starting with .

0 commit comments

Comments
 (0)