2
0
Fork 0
mirror of https://github.com/friendica/docker synced 2025-03-28 22:04:44 +01:00

Merge pull request #85 from nupplaphil/task/improvements_entrypoint

Some improvements
This commit is contained in:
Hypolite Petovan 2019-11-17 03:33:38 -05:00 committed by GitHub
commit 11817715db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 56 additions and 49 deletions

View file

@ -8,4 +8,4 @@ done
# TODO let the database and the autoinstall time to complete - not winning a beauty contest
sleep 15s
php /var/www/html/bin/daemon.php -f start
exec php /var/www/html/bin/daemon.php -f start

View file

@ -3,10 +3,11 @@ set -eu
# run an command with the www-data user
run_as() {
set -- -eu -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh -c "cd /var/www/html;$1"
su - www-data -s /bin/sh "$@"
else
sh -c "$1"
sh "$@"
fi
}
@ -44,10 +45,10 @@ clone_develop() {
# Removing the whole directory first
rm -fr /usr/src/friendica
sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo} /usr/src/friendica"
git clone -q -b ${friendica_git} "https://github.com/${friendica_repo}" /usr/src/friendica
mkdir /usr/src/friendica/addon
sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo} /usr/src/friendica/addon"
git clone -q -b ${addons_git} "https://github.com/${friendica_addons_repo}" /usr/src/friendica/addon
echo "Download finished"
@ -200,7 +201,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
echo "Starting Friendica installation ..."
# TODO Let the database time to warm up - not winning a beauty contest
sleep 10s
run_as "cd /var/www/html; php /var/www/html/bin/console.php autoinstall $install_options"
run_as "php /var/www/html/bin/console.php autoinstall $install_options"
# TODO Workaround because of a strange permission issue
rm -fr /var/www/html/view/smarty3/compiled
@ -217,7 +218,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
# upgrade
else
echo "Upgrading Friendica ..."
run_as 'cd /var/www/html; php /var/www/html/bin/console.php dbstructure update'
run_as 'php /var/www/html/bin/console.php dbstructure update'
echo "Upgrading finished"
fi
fi

View file

@ -8,4 +8,4 @@ done
# TODO let the database and the autoinstall time to complete - not winning a beauty contest
sleep 15s
php /var/www/html/bin/daemon.php -f start
exec php /var/www/html/bin/daemon.php -f start

View file

@ -3,10 +3,11 @@ set -eu
# run an command with the www-data user
run_as() {
set -- -eu -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh -c "cd /var/www/html;$1"
su - www-data -s /bin/sh "$@"
else
sh -c "$1"
sh "$@"
fi
}
@ -44,10 +45,10 @@ clone_develop() {
# Removing the whole directory first
rm -fr /usr/src/friendica
sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo} /usr/src/friendica"
git clone -q -b ${friendica_git} "https://github.com/${friendica_repo}" /usr/src/friendica
mkdir /usr/src/friendica/addon
sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo} /usr/src/friendica/addon"
git clone -q -b ${addons_git} "https://github.com/${friendica_addons_repo}" /usr/src/friendica/addon
echo "Download finished"
@ -200,7 +201,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
echo "Starting Friendica installation ..."
# TODO Let the database time to warm up - not winning a beauty contest
sleep 10s
run_as "cd /var/www/html; php /var/www/html/bin/console.php autoinstall $install_options"
run_as "php /var/www/html/bin/console.php autoinstall $install_options"
# TODO Workaround because of a strange permission issue
rm -fr /var/www/html/view/smarty3/compiled
@ -217,7 +218,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
# upgrade
else
echo "Upgrading Friendica ..."
run_as 'cd /var/www/html; php /var/www/html/bin/console.php dbstructure update'
run_as 'php /var/www/html/bin/console.php dbstructure update'
echo "Upgrading finished"
fi
fi

View file

@ -8,4 +8,4 @@ done
# TODO let the database and the autoinstall time to complete - not winning a beauty contest
sleep 15s
php /var/www/html/bin/daemon.php -f start
exec php /var/www/html/bin/daemon.php -f start

View file

@ -3,10 +3,11 @@ set -eu
# run an command with the www-data user
run_as() {
set -- -eu -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh -c "cd /var/www/html;$1"
su - www-data -s /bin/sh "$@"
else
sh -c "$1"
sh "$@"
fi
}
@ -44,10 +45,10 @@ clone_develop() {
# Removing the whole directory first
rm -fr /usr/src/friendica
sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo} /usr/src/friendica"
git clone -q -b ${friendica_git} "https://github.com/${friendica_repo}" /usr/src/friendica
mkdir /usr/src/friendica/addon
sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo} /usr/src/friendica/addon"
git clone -q -b ${addons_git} "https://github.com/${friendica_addons_repo}" /usr/src/friendica/addon
echo "Download finished"
@ -200,7 +201,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
echo "Starting Friendica installation ..."
# TODO Let the database time to warm up - not winning a beauty contest
sleep 10s
run_as "cd /var/www/html; php /var/www/html/bin/console.php autoinstall $install_options"
run_as "php /var/www/html/bin/console.php autoinstall $install_options"
# TODO Workaround because of a strange permission issue
rm -fr /var/www/html/view/smarty3/compiled
@ -217,7 +218,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
# upgrade
else
echo "Upgrading Friendica ..."
run_as 'cd /var/www/html; php /var/www/html/bin/console.php dbstructure update'
run_as 'php /var/www/html/bin/console.php dbstructure update'
echo "Upgrading finished"
fi
fi

View file

@ -8,4 +8,4 @@ done
# TODO let the database and the autoinstall time to complete - not winning a beauty contest
sleep 15s
php /var/www/html/bin/daemon.php -f start
exec php /var/www/html/bin/daemon.php -f start

View file

@ -3,10 +3,11 @@ set -eu
# run an command with the www-data user
run_as() {
set -- -eu -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh -c "cd /var/www/html;$1"
su - www-data -s /bin/sh "$@"
else
sh -c "$1"
sh "$@"
fi
}
@ -44,10 +45,10 @@ clone_develop() {
# Removing the whole directory first
rm -fr /usr/src/friendica
sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo} /usr/src/friendica"
git clone -q -b ${friendica_git} "https://github.com/${friendica_repo}" /usr/src/friendica
mkdir /usr/src/friendica/addon
sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo} /usr/src/friendica/addon"
git clone -q -b ${addons_git} "https://github.com/${friendica_addons_repo}" /usr/src/friendica/addon
echo "Download finished"
@ -200,7 +201,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
echo "Starting Friendica installation ..."
# TODO Let the database time to warm up - not winning a beauty contest
sleep 10s
run_as "cd /var/www/html; php /var/www/html/bin/console.php autoinstall $install_options"
run_as "php /var/www/html/bin/console.php autoinstall $install_options"
# TODO Workaround because of a strange permission issue
rm -fr /var/www/html/view/smarty3/compiled
@ -217,7 +218,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
# upgrade
else
echo "Upgrading Friendica ..."
run_as 'cd /var/www/html; php /var/www/html/bin/console.php dbstructure update'
run_as 'php /var/www/html/bin/console.php dbstructure update'
echo "Upgrading finished"
fi
fi

View file

@ -8,4 +8,4 @@ done
# TODO let the database and the autoinstall time to complete - not winning a beauty contest
sleep 15s
php /var/www/html/bin/daemon.php -f start
exec php /var/www/html/bin/daemon.php -f start

View file

@ -3,10 +3,11 @@ set -eu
# run an command with the www-data user
run_as() {
set -- -eu -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh -c "cd /var/www/html;$1"
su - www-data -s /bin/sh "$@"
else
sh -c "$1"
sh "$@"
fi
}
@ -44,10 +45,10 @@ clone_develop() {
# Removing the whole directory first
rm -fr /usr/src/friendica
sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo} /usr/src/friendica"
git clone -q -b ${friendica_git} "https://github.com/${friendica_repo}" /usr/src/friendica
mkdir /usr/src/friendica/addon
sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo} /usr/src/friendica/addon"
git clone -q -b ${addons_git} "https://github.com/${friendica_addons_repo}" /usr/src/friendica/addon
echo "Download finished"
@ -200,7 +201,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
echo "Starting Friendica installation ..."
# TODO Let the database time to warm up - not winning a beauty contest
sleep 10s
run_as "cd /var/www/html; php /var/www/html/bin/console.php autoinstall $install_options"
run_as "php /var/www/html/bin/console.php autoinstall $install_options"
# TODO Workaround because of a strange permission issue
rm -fr /var/www/html/view/smarty3/compiled
@ -217,7 +218,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
# upgrade
else
echo "Upgrading Friendica ..."
run_as 'cd /var/www/html; php /var/www/html/bin/console.php dbstructure update'
run_as 'php /var/www/html/bin/console.php dbstructure update'
echo "Upgrading finished"
fi
fi

View file

@ -8,4 +8,4 @@ done
# TODO let the database and the autoinstall time to complete - not winning a beauty contest
sleep 15s
php /var/www/html/bin/daemon.php -f start
exec php /var/www/html/bin/daemon.php -f start

View file

@ -3,10 +3,11 @@ set -eu
# run an command with the www-data user
run_as() {
set -- -eu -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh -c "cd /var/www/html;$1"
su - www-data -s /bin/sh "$@"
else
sh -c "$1"
sh "$@"
fi
}
@ -44,10 +45,10 @@ clone_develop() {
# Removing the whole directory first
rm -fr /usr/src/friendica
sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo} /usr/src/friendica"
git clone -q -b ${friendica_git} "https://github.com/${friendica_repo}" /usr/src/friendica
mkdir /usr/src/friendica/addon
sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo} /usr/src/friendica/addon"
git clone -q -b ${addons_git} "https://github.com/${friendica_addons_repo}" /usr/src/friendica/addon
echo "Download finished"
@ -200,7 +201,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
echo "Starting Friendica installation ..."
# TODO Let the database time to warm up - not winning a beauty contest
sleep 10s
run_as "cd /var/www/html; php /var/www/html/bin/console.php autoinstall $install_options"
run_as "php /var/www/html/bin/console.php autoinstall $install_options"
# TODO Workaround because of a strange permission issue
rm -fr /var/www/html/view/smarty3/compiled
@ -217,7 +218,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
# upgrade
else
echo "Upgrading Friendica ..."
run_as 'cd /var/www/html; php /var/www/html/bin/console.php dbstructure update'
run_as 'php /var/www/html/bin/console.php dbstructure update'
echo "Upgrading finished"
fi
fi

View file

@ -8,4 +8,4 @@ done
# TODO let the database and the autoinstall time to complete - not winning a beauty contest
sleep 15s
php /var/www/html/bin/daemon.php -f start
exec php /var/www/html/bin/daemon.php -f start

View file

@ -3,10 +3,11 @@ set -eu
# run an command with the www-data user
run_as() {
set -- -eu -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh -c "cd /var/www/html;$1"
su - www-data -s /bin/sh "$@"
else
sh -c "$1"
sh "$@"
fi
}
@ -44,10 +45,10 @@ clone_develop() {
# Removing the whole directory first
rm -fr /usr/src/friendica
sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo} /usr/src/friendica"
git clone -q -b ${friendica_git} "https://github.com/${friendica_repo}" /usr/src/friendica
mkdir /usr/src/friendica/addon
sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo} /usr/src/friendica/addon"
git clone -q -b ${addons_git} "https://github.com/${friendica_addons_repo}" /usr/src/friendica/addon
echo "Download finished"
@ -200,7 +201,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
echo "Starting Friendica installation ..."
# TODO Let the database time to warm up - not winning a beauty contest
sleep 10s
run_as "cd /var/www/html; php /var/www/html/bin/console.php autoinstall $install_options"
run_as "php /var/www/html/bin/console.php autoinstall $install_options"
# TODO Workaround because of a strange permission issue
rm -fr /var/www/html/view/smarty3/compiled
@ -217,7 +218,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
# upgrade
else
echo "Upgrading Friendica ..."
run_as 'cd /var/www/html; php /var/www/html/bin/console.php dbstructure update'
run_as 'php /var/www/html/bin/console.php dbstructure update'
echo "Upgrading finished"
fi
fi