Make entrypoint setup more granular, optimize s6
This commit is contained in:
parent
95ed6c16df
commit
990b564d06
@ -14,16 +14,26 @@ chown -R seeddms:seeddms /srv/seeddms/conf /srv/seeddms/data
|
||||
export PGPASSWORD=${POSTGRES_PASSWORD}
|
||||
DB_EXISTS=$(psql -h "${POSTGRES_HOST}" -Atc "SELECT 1 FROM \"tblVersion\"" "${POSTGRES_DB}" "${POSTGRES_USER}" 2>/dev/null || true)
|
||||
if [ -z "${DB_EXISTS}" ]; then
|
||||
cat /srv/seeddms/seeddms/install/create_tables-postgres.sql | psql -h "${POSTGRES_HOST}" "${POSTGRES_DB}" "${POSTGRES_USER}"
|
||||
cat /srv/seeddms/seeddms/install/custom.sql | psql -h "${POSTGRES_HOST}" "${POSTGRES_DB}" "${POSTGRES_USER}"
|
||||
echo "Populating database..."
|
||||
cat /srv/seeddms/seeddms/install/create_tables-postgres.sql | psql -h "${POSTGRES_HOST}" "${POSTGRES_DB}" "${POSTGRES_USER}" >/dev/null
|
||||
cat /srv/seeddms/seeddms/install/custom.sql | psql -h "${POSTGRES_HOST}" "${POSTGRES_DB}" "${POSTGRES_USER}" >/dev/null
|
||||
fi
|
||||
# Update admin
|
||||
if [ -n "${SEEDDMS_ADMIN_USER}" ]; then
|
||||
psql -h "${POSTGRES_HOST}" -Atc "UPDATE \"tblUsers\" SET login = '${SEEDDMS_ADMIN_USER}' WHERE id = 1" "${POSTGRES_DB}" "${POSTGRES_USER}" >/dev/null
|
||||
fi
|
||||
if [ -n "${SEEDDMS_ADMIN_PASSWORD}" ]; then
|
||||
psql -h "${POSTGRES_HOST}" -Atc "UPDATE \"tblUsers\" SET pwd = MD5('${SEEDDMS_ADMIN_PASSWORD}') WHERE id = 1" "${POSTGRES_DB}" "${POSTGRES_USER}" >/dev/null
|
||||
fi
|
||||
if [ -n "${SEEDDMS_ADMIN_EMAIL}" ] ; then
|
||||
psql -h "${POSTGRES_HOST}" -Atc "UPDATE \"tblUsers\" SET email = '${SEEDDMS_ADMIN_EMAIL}' WHERE id = 1" "${POSTGRES_DB}" "${POSTGRES_USER}" >/dev/null
|
||||
fi
|
||||
psql -h "${POSTGRES_HOST}" -Atc "UPDATE \"tblUsers\" SET login = '${SEEDDMS_ADMIN_USER}', pwd = MD5('${SEEDDMS_ADMIN_PASSWORD}'), email = '${SEEDDMS_ADMIN_EMAIL}' WHERE id = 1" "${POSTGRES_DB}" "${POSTGRES_USER}"
|
||||
# TODO: Update database
|
||||
# Looks like database schema updates are done only in new minor version (e.g. 6.0.x -> 6.1.x)
|
||||
unset PGPASSWORD
|
||||
|
||||
# Configure SeedDMS
|
||||
/usr/bin/php -f /srv/seeddms/settings-from-env-vars.php
|
||||
php -f /srv/seeddms/settings-from-env-vars.php
|
||||
chown seeddms:seeddms /srv/seeddms/conf/settings.xml
|
||||
|
||||
# Exec into s6 supervisor
|
||||
|
@ -1,5 +1,3 @@
|
||||
#!/bin/execlineb -P
|
||||
#!/bin/execlineb
|
||||
|
||||
/bin/foreground { /bin/s6-svwait -d -t 3000 cron }
|
||||
/bin/foreground { /bin/s6-svwait -d -t 3000 nginx }
|
||||
/bin/foreground { /bin/s6-svwait -d -t 3000 php-fpm }
|
||||
exit 0
|
||||
|
1
seeddms/image.d/etc/services.d/cron/timeout-kill
Normal file
1
seeddms/image.d/etc/services.d/cron/timeout-kill
Normal file
@ -0,0 +1 @@
|
||||
3000
|
1
seeddms/image.d/etc/services.d/nginx/timeout-kill
Normal file
1
seeddms/image.d/etc/services.d/nginx/timeout-kill
Normal file
@ -0,0 +1 @@
|
||||
3000
|
1
seeddms/image.d/etc/services.d/php-fpm/timeout-kill
Normal file
1
seeddms/image.d/etc/services.d/php-fpm/timeout-kill
Normal file
@ -0,0 +1 @@
|
||||
3000
|
Loading…
Reference in New Issue
Block a user