Make WordPress Core

Changeset 56464

Timestamp:
08/24/2023 09:02:47 PM (12 months ago)
Author:
desrosj
Message:

Build/Test Tools: Ensure database containers are prepared for commands.

By default, Docker waits for a container to be started before considering it “ready”. But this does not necessarily mean that it’s ready to receive commands.

This adds a check that ensures the database container is ready to receive commands before proceeding with running commands.

Follow up to [56439], [56440], [56443].

Props rmccue, desrosj.
See #30462, #58867.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docker-compose.yml

    r54096 r56464  
    2626
    2727    depends_on:
    28       - php
     28      php:
     29        condition: service_started
     30      mysql:
     31        condition: service_healthy
    2932
    3033  ##
     
    5255    # Copy or delete the Memcached dropin plugin file as appropriate.
    5356    command: /bin/sh -c "if [ $LOCAL_PHP_MEMCACHED = true ]; then cp -n /var/www/tests/phpunit/includes/object-cache.php /var/www/src/wp-content/object-cache.php; else rm -f /var/www/src/wp-content/object-cache.php; fi && exec php-fpm"
    54 
    55     depends_on:
    56       - mysql
    5757
    5858    # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly.
     
    8484    command: --default-authentication-plugin=mysql_native_password
    8585
     86
     87
     88
     89
     90
     91
    8692  ##
    8793  # The WP CLI container.
     
    108114      - localhost:host-gateway
    109115
     116
     117
     118
     119
     120
     121
    110122  ##
    111123  # The Memcached container.
     
    120132      - 11211:11211
    121133
     134
     135
     136
     137
    122138volumes:
    123139  # So that sites aren't wiped every time containers are restarted, MySQL uses a persistent volume.
Note: See TracChangeset for help on using the changeset viewer.