add wait-for-it and get-variable, these will be used to determine the proper address of the database and wait for it to connect

This commit is contained in:
Adrian Kuschelyagi Malacoda 2019-06-16 14:45:09 -05:00
parent 7d47280ac6
commit c33d4a1f50
3 changed files with 15 additions and 1 deletions

View File

@ -12,6 +12,8 @@ RUN chmod +x add_extension.sh
RUN ./add_extension.sh Scribunto $MEDIAWIKI_BRANCH && \
./add_extension.sh VisualEditor $MEDIAWIKI_BRANCH
ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh /wait-for-it
ADD setup.sh /setup.sh
RUN chmod +x /setup.sh
ADD get-variable /get-variable
RUN chmod +x setup.sh && chmod +x wait-for-it && chmod +x get-variable
CMD ["/setup.sh"]

10
get-variable Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env php
<?php
define("MEDIAWIKI", 1);
define("HTML_ROOT", "/var/www/html");
function wfLoadSkin() {}
function wfLoadExtension() {}
@include HTML_ROOT . "/LocalSettings.php";
print_r($GLOBALS[$argv[1]]);

View File

@ -5,6 +5,8 @@ HTML_ROOT=/var/www/html
# Run updater if we have an existing install
if [[ -e "$HTML_ROOT/LocalSettings.php" ]]; then
cd "$HTML_ROOT/maintenance"
DB_SERVER=$(/get-variable wgDBserver)
/wait-for-it "$DB_SERVER:3306"
php update.php
fi