Skip to content

Commit

Permalink
Add new "wp-config-docker.php" that uses "getenv" for configuration
Browse files Browse the repository at this point in the history
This new method of configuration allows us to stop modifying the user-supplied `wp-config.php` file on every container startup, and instead just let PHP itself read the values directly from the source.

With this change, the "beta" tags are force-reenabled at the same version as the latest releases to allow users to test this before the next release of WordPress (where it is intended that this change will go live for all image variants).
  • Loading branch information
tianon committed Jan 7, 2021
1 parent f6444fd commit 8f5bcc1
Show file tree
Hide file tree
Showing 24 changed files with 1,113 additions and 1,333 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*/**/Dockerfile linguist-generated
/*/**/docker-entrypoint.sh linguist-generated
/*/**/wp-config-docker.php linguist-generated
/Dockerfile.template linguist-language=Dockerfile
3 changes: 3 additions & 0 deletions Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ RUN set -ex; \

VOLUME /var/www/html

{{ if env.version == "beta" then ( -}}
COPY --chown=www-data:www-data wp-config-docker.php /usr/src/wordpress/
{{ ) else "" end -}}
COPY docker-entrypoint.sh /usr/local/bin/

ENTRYPOINT ["docker-entrypoint.sh"]
Expand Down
3 changes: 3 additions & 0 deletions apply-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ for version; do

if [ "$version" = 'cli' ]; then
cp -a cli-entrypoint.sh "$dir/docker-entrypoint.sh"
elif [ "$version" = 'beta' ]; then
cp -a docker-entrypoint-ng.sh "$dir/docker-entrypoint.sh"
cp -a wp-config-docker.php "$dir/"
else
cp -a docker-entrypoint.sh "$dir/"
fi
Expand Down
1 change: 1 addition & 0 deletions beta/php7.3/apache/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

250 changes: 28 additions & 222 deletions beta/php7.3/apache/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8f5bcc1

Please sign in to comment.