Commit c1bd4750 authored by Michael Iseard's avatar Michael Iseard
Browse files

Switch php image to alpine and add imagick

parent 1df7ad4b
# general # general
HOST=sub.domain.com HOST=sub.domain.com
ADMINER_HOST=adminer.domain.com
TRAEFIK_ENABLE=true TRAEFIK_ENABLE=true
CONTAINER_PREFIX=myproject CONTAINER_PREFIX=myproject
PHP_VERSION=7.4 PHP_VERSION=7.4
WORDPRESS_VERSION=latest
# adminer
ADMINER_HOST=adminer.domain.com
ADMINER_PORT=8081
# wordpress - wordpress:php7.3-fpm # wordpress - wordpress:php7.3-fpm
WORDPRESS_DB_NAME=wordpress WORDPRESS_DB_NAME=wordpress
...@@ -24,3 +28,4 @@ NGINX_CONF_DIR=./nginx ...@@ -24,3 +28,4 @@ NGINX_CONF_DIR=./nginx
NGINX_LOG_DIR=./logs/nginx NGINX_LOG_DIR=./logs/nginx
WORDPRESS_DATA_DIR=./wordpress WORDPRESS_DATA_DIR=./wordpress
MYSQL_DATA_DIR=./mysql MYSQL_DATA_DIR=./mysql
ARG PHP_VERSION ARG PHP_VERSION
ARG WORDPRESS_VERSION
FROM php:${PHP_VERSION}-fpm FROM php:${PHP_VERSION}-fpm-alpine
# persistent dependencies
RUN apk add --no-cache \
bash \
sed \
ghostscript \
imagemagick
# install the PHP extensions we need # install the PHP extensions we need
RUN apt-get update && apt-get install -y \ RUN apk add --no-cache --virtual .build-deps \
libfreetype6-dev \ $PHPIZE_DEPS \
libjpeg62-turbo-dev \ freetype-dev \
imagemagick-dev \
libjpeg-turbo-dev \
libpng-dev \ libpng-dev \
libxml2-dev libzip-dev \
icu-dev
# libxml2-dev
RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \ # install and enable redis and imagmagick
&& docker-php-ext-install -j$(nproc) \ RUN pecl install redis imagick \
gd \ && docker-php-ext-enable redis imagick
iconv \
soap \ # more extensions
RUN docker-php-ext-install -j "$(nproc)" \
bcmath \
exif \ exif \
intl \ gd \
mysqli mysqli \
zip
RUN pecl install redis && docker-php-ext-enable redis # final dependencies
RUN runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --virtual .wordpress-phpexts-rundeps $runDeps; \
apk del .build-deps
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN set -eux; \
docker-php-ext-enable opcache; \
{ \
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'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
# https://wordpress.org/support/article/editing-wp-config-php/#configure-error-logging
RUN { \
# https://www.php.net/manual/en/errorfunc.constants.php
# https://github.com/docker-library/wordpress/issues/420#issuecomment-517839670
echo 'error_reporting = E_ERROR | E_WARNING | E_PARSE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_RECOVERABLE_ERROR'; \
echo 'display_errors = Off'; \
echo 'display_startup_errors = Off'; \
echo 'log_errors = On'; \
echo 'error_log = /dev/stderr'; \
echo 'log_errors_max_len = 1024'; \
echo 'ignore_repeated_errors = On'; \
echo 'ignore_repeated_source = Off'; \
echo 'html_errors = Off'; \
} > /usr/local/etc/php/conf.d/error-logging.ini
VOLUME /var/www/html VOLUME /var/www/html
COPY docker-entrypoint.sh /entrypoint.sh COPY docker-entrypoint.sh /entrypoint.sh
RUN curl -o wordpress.tar.gz -SL https://wordpress.org/latest.tar.gz \ RUN set ex; \
&& tar -xzf wordpress.tar.gz -C /usr/src/ \ curl -o wordpress.tar.gz -fSL "https://wordpress.org/latest.tar.gz"; \
&& rm wordpress.tar.gz \ # echo "$WORDPRESS_SHA1 *wordpress.tar.gz" | sha1sum -c -; \
&& chown -R www-data:www-data /usr/src/wordpress # upstream tarballs include ./wordpress/ so this gives us /usr/src/wordpress
tar -xzf wordpress.tar.gz -C /usr/src/; \
rm wordpress.tar.gz; \
chown -R www-data:www-data /usr/src/wordpress; \
# pre-create wp-content (and single-level children) for folks who want to bind-mount themes, etc so permissions are pre-created properly instead of root:root
mkdir wp-content; \
for dir in /usr/src/wordpress/wp-content/*/; do \
dir="$(basename "${dir%/}")"; \
mkdir "wp-content/$dir"; \
done; \
chown -R www-data:www-data wp-content; \
chmod -R 777 wp-content
ENTRYPOINT ["/entrypoint.sh"] VOLUME /var/www/html
EXPOSE 9000 COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["php-fpm"] CMD ["php-fpm"]
#!/bin/bash #!/bin/bash
set -e set -euo pipefail
if [ -n "$MYSQL_PORT_3306_TCP" ]; then # usage: file_env VAR [DEFAULT]
if [ -z "$WORDPRESS_DB_HOST" ]; then # ie: file_env 'XYZ_DB_PASSWORD' 'example'
WORDPRESS_DB_HOST='mysql' # (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
else # "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
echo >&2 'warning: both WORDPRESS_DB_HOST and MYSQL_PORT_3306_TCP found' file_env() {
echo >&2 " Connecting to WORDPRESS_DB_HOST ($WORDPRESS_DB_HOST)" local var="$1"
echo >&2 ' instead of the linked mysql container' local fileVar="${var}_FILE"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1
fi fi
fi local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi
export "$var"="$val"
unset "$fileVar"
}
if [ -z "$WORDPRESS_DB_HOST" ]; then if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
echo >&2 'error: missing WORDPRESS_DB_HOST and MYSQL_PORT_3306_TCP environment variables' if [ "$(id -u)" = '0' ]; then
echo >&2 ' Did you forget to --link some_mysql_container:mysql or set an external db' case "$1" in
echo >&2 ' with -e WORDPRESS_DB_HOST=hostname:port?' apache2*)
exit 1 user="${APACHE_RUN_USER:-www-data}"
fi group="${APACHE_RUN_GROUP:-www-data}"
# if we're linked to MySQL, and we're using the root user, and our linked # strip off any '#' symbol ('#1000' is valid syntax for Apache)
# container has a default "root" password set up and passed through... :) pound='#'
: ${WORDPRESS_DB_USER:=root} user="${user#$pound}"
if [ "$WORDPRESS_DB_USER" = 'root' ]; then group="${group#$pound}"
: ${WORDPRESS_DB_PASSWORD:=$MYSQL_ENV_MYSQL_ROOT_PASSWORD} ;;
fi *) # php-fpm
: ${WORDPRESS_DB_NAME:=wordpress} user='www-data'
group='www-data'
if [ -z "$WORDPRESS_DB_PASSWORD" ]; then ;;
echo >&2 'error: missing required WORDPRESS_DB_PASSWORD environment variable' esac
echo >&2 ' Did you forget to -e WORDPRESS_DB_PASSWORD=... ?' else
echo >&2 user="$(id -u)"
echo >&2 ' (Also of interest might be WORDPRESS_DB_USER and WORDPRESS_DB_NAME.)' group="$(id -g)"
exit 1 fi
fi
if ! [ -e index.php -a -e wp-includes/version.php ]; then if [ ! -e index.php ] && [ ! -e wp-includes/version.php ]; then
echo >&2 "WordPress not found in $(pwd) - copying now..." # if the directory exists and WordPress doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory)
if [ "$(ls -A)" ]; then if [ "$(id -u)" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then
echo >&2 "WARNING: $(pwd) is not empty - press Ctrl+C now if this is an error!" chown "$user:$group" .
( set -x; ls -A; sleep 10 ) fi
echo >&2 "WordPress not found in $PWD - copying now..."
if [ -n "$(find -mindepth 1 -maxdepth 1 -not -name wp-content)" ]; then
echo >&2 "WARNING: $PWD is not empty! (copying anyhow)"
fi
sourceTarArgs=(
--create
--file -
--directory /usr/src/wordpress
--owner "$user" --group "$group"
)
targetTarArgs=(
--extract
--file -
)
if [ "$user" != '0' ]; then
# avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
targetTarArgs+=( --no-overwrite-dir )
fi
# loop over "pluggable" content in the source, and if it already exists in the destination, skip it
# https://github.com/docker-library/wordpress/issues/506 ("wp-content" persisted, "akismet" updated, WordPress container restarted/recreated, "akismet" downgraded)
for contentDir in /usr/src/wordpress/wp-content/*/*/; do
contentDir="${contentDir%/}"
[ -d "$contentDir" ] || continue
contentPath="${contentDir#/usr/src/wordpress/}" # "wp-content/plugins/akismet", etc.
if [ -d "$PWD/$contentPath" ]; then
echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the WordPress version)"
sourceTarArgs+=( --exclude "./$contentPath" )
fi
done
tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}"
echo >&2 "Complete! WordPress has been successfully copied to $PWD"
if [ ! -e .htaccess ]; then
# NOTE: The "Indexes" option is disabled in the php:apache base image
cat > .htaccess <<-'EOF'
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
EOF
chown "$user:$group" .htaccess
fi
fi fi
tar cf - --one-file-system -C /usr/src/wordpress . | tar xf -
echo >&2 "Complete! WordPress has been successfully copied to $(pwd)" # allow any of these "Authentication Unique Keys and Salts." to be specified via
if [ ! -e .htaccess ]; then # environment variables with a "WORDPRESS_" prefix (ie, "WORDPRESS_AUTH_KEY")
# NOTE: The "Indexes" option is disabled in the php:apache base image uniqueEnvs=(
cat > .htaccess <<-'EOF' AUTH_KEY
# BEGIN WordPress SECURE_AUTH_KEY
<IfModule mod_rewrite.c> LOGGED_IN_KEY
RewriteEngine On NONCE_KEY
RewriteBase / AUTH_SALT
RewriteRule ^index\.php$ - [L] SECURE_AUTH_SALT
RewriteCond %{REQUEST_FILENAME} !-f LOGGED_IN_SALT
RewriteCond %{REQUEST_FILENAME} !-d NONCE_SALT
RewriteRule . /index.php [L] )
</IfModule> envs=(
# END WordPress WORDPRESS_DB_HOST
EOF WORDPRESS_DB_USER
chown www-data:www-data .htaccess WORDPRESS_DB_PASSWORD
WORDPRESS_DB_NAME
WORDPRESS_DB_CHARSET
WORDPRESS_DB_COLLATE
"${uniqueEnvs[@]/#/WORDPRESS_}"
WORDPRESS_TABLE_PREFIX
WORDPRESS_DEBUG
WORDPRESS_CONFIG_EXTRA
)
haveConfig=
for e in "${envs[@]}"; do
file_env "$e"
if [ -z "$haveConfig" ] && [ -n "${!e}" ]; then
haveConfig=1
fi
done
# linking backwards-compatibility
if [ -n "${!MYSQL_ENV_MYSQL_*}" ]; then
haveConfig=1
# host defaults to "mysql" below if unspecified
: "${WORDPRESS_DB_USER:=${MYSQL_ENV_MYSQL_USER:-root}}"
if [ "$WORDPRESS_DB_USER" = 'root' ]; then
: "${WORDPRESS_DB_PASSWORD:=${MYSQL_ENV_MYSQL_ROOT_PASSWORD:-}}"
else
: "${WORDPRESS_DB_PASSWORD:=${MYSQL_ENV_MYSQL_PASSWORD:-}}"
fi
: "${WORDPRESS_DB_NAME:=${MYSQL_ENV_MYSQL_DATABASE:-}}"
fi fi
fi
# TODO handle WordPress upgrades magically in the same way, but only if wp-includes/version.php's $wp_version is less than /usr/src/wordpress/wp-includes/version.php's $wp_version # only touch "wp-config.php" if we have environment-supplied configuration values
if [ "$haveConfig" ]; then
: "${WORDPRESS_DB_HOST:=mysql}"
: "${WORDPRESS_DB_USER:=root}"
: "${WORDPRESS_DB_PASSWORD:=}"
: "${WORDPRESS_DB_NAME:=wordpress}"
: "${WORDPRESS_DB_CHARSET:=utf8}"
: "${WORDPRESS_DB_COLLATE:=}"
if [ ! -e wp-config.php ]; then # version 4.4.1 decided to switch to windows line endings, that breaks our seds and awks
awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' # https://github.com/docker-library/wordpress/issues/116
// If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact # https://github.com/WordPress/WordPress/commit/1acedc542fba2482bab88ec70d4bea4b997a92e4
sed -ri -e 's/\r$//' wp-config*
if [ ! -e wp-config.php ]; then
awk '
/^\/\*.*stop editing.*\*\/$/ && c == 0 {
c = 1
system("cat")
if (ENVIRON["WORDPRESS_CONFIG_EXTRA"]) {
print "// WORDPRESS_CONFIG_EXTRA"
print ENVIRON["WORDPRESS_CONFIG_EXTRA"] "\n"
}
}
{ print }
' wp-config-sample.php > wp-config.php <<'EOPHP'
// If we're behind a proxy server and using HTTPS, we need to alert WordPress of that fact
// see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy // see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
$_SERVER['HTTPS'] = 'on'; $_SERVER['HTTPS'] = 'on';
} }
EOPHP EOPHP
chown www-data:www-data wp-config.php chown "$user:$group" wp-config.php
fi elif [ -e wp-config.php ] && [ -n "$WORDPRESS_CONFIG_EXTRA" ] && [[ "$(< wp-config.php)" != *"$WORDPRESS_CONFIG_EXTRA"* ]]; then
# (if the config file already contains the requested PHP code, don't print a warning)
echo >&2
echo >&2 'WARNING: environment variable "WORDPRESS_CONFIG_EXTRA" is set, but "wp-config.php" already exists'
echo >&2 ' The contents of this variable will _not_ be inserted into the existing "wp-config.php" file.'
echo >&2 ' (see https://github.com/docker-library/wordpress/issues/333 for more details)'
echo >&2
fi
set_config() { # see http://stackoverflow.com/a/2705678/433558
key="$1" sed_escape_lhs() {
value="$2" echo "$@" | sed -e 's/[]\/$*.^|[]/\\&/g'
php_escaped_value="$(php -r 'var_export($argv[1]);' "$value")" }
sed_escaped_value="$(echo "$php_escaped_value" | sed 's/[\/&]/\\&/g')" sed_escape_rhs() {
sed -ri "s/((['\"])$key\2\s*,\s*)(['\"]).*\3/\1$sed_escaped_value/" wp-config.php echo "$@" | sed -e 's/[\/&]/\\&/g'
} }
php_escape() {
local escaped="$(php -r 'var_export(('"$2"') $argv[1]);' -- "$1")"
if [ "$2" = 'string' ] && [ "${escaped:0:1}" = "'" ]; then
escaped="${escaped//$'\n'/"' + \"\\n\" + '"}"
fi
echo "$escaped"
}
set_config() {
key="$1"
value="$2"
var_type="${3:-string}"
start="(['\"])$(sed_escape_lhs "$key")\2\s*,"
end="\);"
if [ "${key:0:1}" = '$' ]; then
start="^(\s*)$(sed_escape_lhs "$key")\s*="
end=";"
fi
sed -ri -e "s/($start\s*).*($end)$/\1$(sed_escape_rhs "$(php_escape "$value" "$var_type")")\3/" wp-config.php
}
set_config 'DB_HOST' "$WORDPRESS_DB_HOST" set_config 'DB_HOST' "$WORDPRESS_DB_HOST"
set_config 'DB_USER' "$WORDPRESS_DB_USER" set_config 'DB_USER' "$WORDPRESS_DB_USER"
set_config 'DB_PASSWORD' "$WORDPRESS_DB_PASSWORD" set_config 'DB_PASSWORD' "$WORDPRESS_DB_PASSWORD"
set_config 'DB_NAME' "$WORDPRESS_DB_NAME" set_config 'DB_NAME' "$WORDPRESS_DB_NAME"
set_config 'DB_CHARSET' "$WORDPRESS_DB_CHARSET"
# allow any of these "Authentication Unique Keys and Salts." to be specified via set_config 'DB_COLLATE' "$WORDPRESS_DB_COLLATE"
# environment variables with a "WORDPRESS_" prefix (ie, "WORDPRESS_AUTH_KEY")
UNIQUES=( for unique in "${uniqueEnvs[@]}"; do
AUTH_KEY uniqVar="WORDPRESS_$unique"
SECURE_AUTH_KEY if [ -n "${!uniqVar}" ]; then
LOGGED_IN_KEY set_config "$unique" "${!uniqVar}"
NONCE_KEY else
AUTH_SALT # if not specified, let's generate a random value
SECURE_AUTH_SALT currentVal="$(sed -rn -e "s/define\(\s*(([\'\"])$unique\2\s*,\s*)(['\"])(.*)\3\s*\);/\4/p" wp-config.php)"
LOGGED_IN_SALT if [ "$currentVal" = 'put your unique phrase here' ]; then
NONCE_SALT set_config "$unique" "$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)"
) fi
for unique in "${UNIQUES[@]}"; do fi
eval unique_value=\$WORDPRESS_$unique done
if [ "$unique_value" ]; then
set_config "$unique" "$unique_value" if [ "$WORDPRESS_TABLE_PREFIX" ]; then
else set_config '$table_prefix' "$WORDPRESS_TABLE_PREFIX"
# if not specified, let's generate a random value
current_set="$(sed -rn "s/define\((([\'\"])$unique\2\s*,\s*)(['\"])(.*)\3\);/\4/p" wp-config.php)"
if [ "$current_set" = 'put your unique phrase here' ]; then
set_config "$unique" "$(head -c1M /dev/urandom | sha1sum | cut -d' ' -f1)"
fi fi
fi
done
TERM=dumb php -- "$WORDPRESS_DB_HOST" "$WORDPRESS_DB_USER" "$WORDPRESS_DB_PASSWORD" "$WORDPRESS_DB_NAME" <<'EOPHP' if [ "$WORDPRESS_DEBUG" ]; then
set_config 'WP_DEBUG' 1 boolean
fi
if ! TERM=dumb php -- <<'EOPHP'
<?php <?php
// database might not exist, so let's try creating it (just to be safe) // database might not exist, so let's try creating it (just to be safe)
$stderr = fopen('php://stderr', 'w'); $stderr = fopen('php://stderr', 'w');
list($host, $port) = explode(':', $argv[1], 2); // https://codex.wordpress.org/Editing_wp-config.php#MySQL_Alternate_Port
// "hostname:port"
// https://codex.wordpress.org/Editing_wp-config.php#MySQL_Sockets_or_Pipes
// "hostname:unix-socket-path"
list($host, $socket) = explode(':', getenv('WORDPRESS_DB_HOST'), 2);
$port = 0;
if (is_numeric($socket)) {
$port = (int) $socket;
$socket = null;
}
$user = getenv('WORDPRESS_DB_USER');
$pass = getenv('WORDPRESS_DB_PASSWORD');
$dbName = getenv('WORDPRESS_DB_NAME');
$maxTries = 10; $maxTries = 10;
do { do {
$mysql = new mysqli($host, $argv[2], $argv[3], '', (int)$port); $mysql = new mysqli($host, $user, $pass, '', $port, $socket);
if ($mysql->connect_error) { if ($mysql->connect_error) {
fwrite($stderr, "\n" . 'MySQL Connection Error: (' . $mysql->connect_errno . ') ' . $mysql->connect_error . "\n"); fwrite($stderr, "\n" . 'MySQL Connection Error: (' . $mysql->connect_errno . ') ' . $mysql->connect_error . "\n");
--$maxTries; --$maxTries;
...@@ -128,12 +271,25 @@ do { ...@@ -128,12 +271,25 @@ do {
sleep(3); sleep(3);
} }
} while ($mysql->connect_error); } while ($mysql->connect_error);
if (!$mysql->query('CREATE DATABASE IF NOT EXISTS `' . $mysql->real_escape_string($argv[4]) . '`')) { if (!$mysql->query('CREATE DATABASE IF NOT EXISTS `' . $mysql->real_escape_string($dbName) . '`')) {
fwrite($stderr, "\n" . 'MySQL "CREATE DATABASE" Error: ' . $mysql->error . "\n"); fwrite($stderr, "\n" . 'MySQL "CREATE DATABASE" Error: ' . $mysql->error . "\n");
$mysql->close(); $mysql->close();
exit(1); exit(1);
} }
$mysql->close(); $mysql->close();
EOPHP EOPHP
then
echo >&2
echo >&2 "WARNING: unable to establish a database connection to '$WORDPRESS_DB_HOST'"
echo >&2 ' continuing anyways (which might have unexpected results)'
echo >&2
fi
fi
# now that we're definitely done writing configuration, let's clear out the relevant envrionment variables (so that stray "phpinfo()" calls don't leak secrets from our code)
for e in "${envs[@]}"; do
unset "$e"
done
fi
exec "$@" exec "$@"
...@@ -44,6 +44,7 @@ services: ...@@ -44,6 +44,7 @@ services:
context: ./build/wordpress context: ./build/wordpress
args: args:
PHP_VERSION: ${PHP_VERSION:-7.3} PHP_VERSION: ${PHP_VERSION:-7.3}
WORDPRESS_VERSION: ${WORDPRESS_VERSION:-5.4}
container_name: ${CONTAINER_PREFIX}-wordpress container_name: ${CONTAINER_PREFIX}-wordpress
networks: networks:
- default - default
...@@ -53,11 +54,13 @@ services: ...@@ -53,11 +54,13 @@ services:
- ${WORDPRESS_DIR:-./wordpress}:/var/www/html/ - ${WORDPRESS_DIR:-./wordpress}:/var/www/html/
- ${PHP_UPLOADS:-./php/uploads.ini}:/usr/local/etc/php/conf.d/uploads.ini - ${PHP_UPLOADS:-./php/uploads.ini}:/usr/local/etc/php/conf.d/uploads.ini
environment: environment:
- WORDPRESS_DB_NAME=${MYSQL_DATABASE:-wordpress} WORDPRESS_DB_NAME: ${MYSQL_DATABASE:-wordpress}
- WORDPRESS_TABLE_PREFIX=${WORDPRESS_TABLE_PREFIX:-wp_} WORDPRESS_TABLE_PREFIX: ${WORDPRESS_TABLE_PREFIX:-wp_}
- WORDPRESS_DB_HOST=db WORDPRESS_DB_HOST: db
- WORDPRESS_DB_USER=${MYSQL_USER:-root} WORDPRESS_DB_USER: ${MYSQL_USER:-root}
- WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD:-password} WORDPRESS_DB_PASSWORD: ${MYSQL_PASSWORD:-password}
WORDPRESS_CONFIG_EXTRA: |
define('FS_METHOD', 'direct');
restart: always restart: always
nginx: nginx:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment