[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 b1afa9cf91
commit 50e450f082
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
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}" CMD="mysqladmin ping --silent -hdb -uroot -p${MYSQL_ROOT_PASSWORD}"
;; ;;
"postgres") "postgres")
CMD="pg_isready -hdb -q" CMD="pg_isready -hdb -q -Upostgres"
;; ;;
*) *)
exit 1 exit 1

View File

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

View File

@ -1,6 +1,11 @@
#!/bin/sh #!/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" echo -e "Installing GNU social\nInstalling composer dependencies"
@ -8,13 +13,10 @@ if [ ! -e /var/www/social/config.php ]; then
composer install composer install
chmod g+w -R /var/www/social chmod g+w -R .
chown -R :www-data /var/www/social chown -R :www-data .
php /var/www/social/scripts/install_cli.php --server="${SOCIAL_DOMAIN}" --sitename="${SOCIAL_SITENAME}" \ php bin/console doctrine:database:create || exit 1
--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
echo "GNU social is installed" echo "GNU social is installed"
fi fi