-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
51 lines (40 loc) · 1.58 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
FROM php:7-apache
ARG WORDPRESS_DB_USER=root
ARG WORDPRESS_DB_PASSWORD=root
ARG WORDPRESS_DB_NAME=wordpress
ARG WORDPRESS_DB_HOST=mysql
# install the PHP extensions we need
RUN set -ex; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libjpeg-dev \
libpng-dev \
mariadb-client \
; \
rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-configure gd; \
docker-php-ext-install gd mysqli opcache pdo pdo_mysql
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
RUN a2enmod rewrite expires
WORKDIR /var/www/html
# Download WP-CLI, install and configure Wordpress
RUN curl -O "https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar"; \
chmod +x wp-cli.phar; \
mv wp-cli.phar /usr/local/bin/wp; \
wp --info --allow-root --debug; \
wp core download --allow-root --force --debug; \
wp core config --dbname=$WORDPRESS_DB_NAME --dbuser=$WORDPRESS_DB_USER --dbpass=$WORDPRESS_DB_PASSWORD --dbhost=$WORDPRESS_DB_HOST --force --allow-root --debug --skip-check --extra-php="define( 'WP_DEBUG', true );define( 'WP_DEBUG_LOG', true );define( 'FS_METHOD', 'direct' );";
COPY wait-for-it.sh /usr/local/bin/
COPY entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/wait-for-it.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
EXPOSE 80
ENTRYPOINT /usr/local/bin/entrypoint.sh