Commit 1412535e authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Add a liveness-probe MU plugin

parent 73dc5930
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ COPY --from=compile /usr/local/lib/php /usr/local/lib/php
RUN --mount=type=bind,source=scripts/install-wp.sh,target=/stage \
    /stage ${wp_version}

COPY probe.php wp-content/mu-plugins/
COPY opcache.ini /usr/local/etc/php/conf.d/opcache-recommended.ini
COPY wp-config.php /usr/share/wordpress/wp-config.php
COPY entrypoint.sh /bin/entrypoint

probe.php

0 → 100644
+16 −0
Original line number Diff line number Diff line
<?php
/**
 * Plugin Name: Liveness probe
 * Description: Responds to requests to /.probe with an HTTP code indicating the
 *              status of the app
 * Licence: MPL-2.0
 * Author: Dominik Sekotill
 */


if ( parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) == '/.probe' ):

add_filter('option_active_plugins', function( $plugins ) { return array(); });
add_action('setup_theme', function() { exit(200); });

endif;