Skip to content

Commit 8829afc

Browse files
committed
Allow to run only the WordPress initialization sequence
1 parent 50da133 commit 8829afc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docker-entrypoint.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -Eeuo pipefail
33

4-
if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then
4+
if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ] || [ -n "$WORDPRESS_INIT_ONLY" ]; then
55
uid="$(id -u)"
66
gid="$(id -g)"
77
if [ "$uid" = '0' ]; then
@@ -96,4 +96,9 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then
9696
fi
9797
fi
9898

99+
if [ -n "$WORDPRESS_INIT_ONLY" ]; then
100+
echo >&2 "WordPress initialization complete; exiting"
101+
exit 0
102+
fi
103+
99104
exec "$@"

0 commit comments

Comments
 (0)