[TOOLS][DOCKER] Further fixes in the docker environment and fixed the install script

This commit is contained in:
Hugo Sales 2020-05-06 15:32:07 +00:00 committed by Hugo Sales
parent 3b50815422
commit cef20e1332
3 changed files with 12 additions and 8 deletions

View File

@ -5,7 +5,7 @@ case $DBMS in
CMD="mysqladmin ping --silent -hdb -uroot -p${MYSQL_ROOT_PASSWORD}"
;;
"postgres")
CMD="pg_isready -hdb -q"
CMD="pg_isready -hdb -q -Upostgres"
;;
*)
exit 1

View File

@ -11,3 +11,5 @@ RUN apk add --virtual .phpize-deps $PHPIZE_DEPS \
&& apk del .phpize-deps > /dev/null
RUN docker-php-ext-install ${exts}
WORKDIR /var/www/social

View File

@ -1,6 +1,11 @@
#!/bin/sh
if [ ! -e /var/www/social/config.php ]; then
PGPASSWORD="${POSTGRES_PASSWORD}" psql -ltq -Upostgres -hdb | \
cut -d '|' -f1 | grep -wq "${SOCIAL_DB}"
if [ ! $? ]; then
echo ${SOCIAL_DB}
echo -e "Installing GNU social\nInstalling composer dependencies"
@ -8,13 +13,10 @@ if [ ! -e /var/www/social/config.php ]; then
composer install
chmod g+w -R /var/www/social
chown -R :www-data /var/www/social
chmod g+w -R .
chown -R :www-data .
php /var/www/social/scripts/install_cli.php --server="${SOCIAL_DOMAIN}" --sitename="${SOCIAL_SITENAME}" \
--host=db --fancy=yes --database="${SOCIAL_DB}" \
--username="${SOCIAL_USER}" --password="${SOCIAL_PASSWORD}" \
--admin-nick="${SOCIAL_ADMIN_NICK}" --admin-pass="${SOCIAL_ADMIN_PASSWORD}" || exit 1
php bin/console doctrine:database:create || exit 1
echo "GNU social is installed"
fi