Put uploads dir in docker volume
This commit is contained in:
parent
71e5dd4eca
commit
5da3d73fd3
@ -12,6 +12,9 @@ sed -i "s/^nobody:.*$/nobody:x:50:/" /etc/group
|
|||||||
|
|
||||||
# Prepare ulogger filesystem
|
# Prepare ulogger filesystem
|
||||||
grep '^[$<?]' /var/www/html/config.default.php > /var/www/html/config.php
|
grep '^[$<?]' /var/www/html/config.default.php > /var/www/html/config.php
|
||||||
|
mkdir -p /data/uploads
|
||||||
|
rm -rf /var/www/html/uploads
|
||||||
|
ln -s /data/uploads /var/www/html/uploads
|
||||||
chown nobody:nobody /var/www/html/uploads
|
chown nobody:nobody /var/www/html/uploads
|
||||||
chmod 775 /var/www/html/uploads
|
chmod 775 /var/www/html/uploads
|
||||||
|
|
||||||
@ -24,7 +27,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$ULOGGER_DB_DRIVER" = "pgsql" ]; then
|
if [ "$ULOGGER_DB_DRIVER" = "pgsql" ]; then
|
||||||
export PGDATA=/data
|
export PGDATA=/data/pgsql
|
||||||
mkdir -p ${PGDATA} /run/postgresql /etc/postgres
|
mkdir -p ${PGDATA} /run/postgresql /etc/postgres
|
||||||
chown postgres:postgres ${PGDATA} /run/postgresql /etc/postgres
|
chown postgres:postgres ${PGDATA} /run/postgresql /etc/postgres
|
||||||
su postgres -c "initdb --auth-host=md5 --auth-local=trust --locale=en_US.utf-8 --encoding=utf8"
|
su postgres -c "initdb --auth-host=md5 --auth-local=trust --locale=en_US.utf-8 --encoding=utf8"
|
||||||
@ -43,15 +46,15 @@ if [ "$ULOGGER_DB_DRIVER" = "pgsql" ]; then
|
|||||||
sed -i "s/^\$dbdsn = .*$/\$dbdsn = \"pgsql:host=localhost;port=5432;dbname=ulogger\";/" /var/www/html/config.php
|
sed -i "s/^\$dbdsn = .*$/\$dbdsn = \"pgsql:host=localhost;port=5432;dbname=ulogger\";/" /var/www/html/config.php
|
||||||
elif [ "$ULOGGER_DB_DRIVER" = "sqlite" ]; then
|
elif [ "$ULOGGER_DB_DRIVER" = "sqlite" ]; then
|
||||||
mkdir -p /data/sqlite
|
mkdir -p /data/sqlite
|
||||||
chown -R nobody:nobody /data
|
chown -R nobody:nobody /data/sqlite
|
||||||
sqlite3 -init /var/www/html/scripts/ulogger.sqlite /data/sqlite/ulogger.db .exit
|
sqlite3 -init /var/www/html/scripts/ulogger.sqlite /data/sqlite/ulogger.db .exit
|
||||||
sqlite3 -line /data/ulogger.db "INSERT INTO users (login, password, admin) VALUES ('${ULOGGER_ADMIN_USER}', '\$2y\$10\$7OvZrKgonVZM9lkzrTbiou.CVhO3HjPk5y0W9L68fVwPs/osBRIMq', 1)"
|
sqlite3 -line /data/sqlite/ulogger.db "INSERT INTO users (login, password, admin) VALUES ('${ULOGGER_ADMIN_USER}', '\$2y\$10\$7OvZrKgonVZM9lkzrTbiou.CVhO3HjPk5y0W9L68fVwPs/osBRIMq', 1)"
|
||||||
sed -i "s/^\$dbdsn = .*$/\$dbdsn = \"sqlite:\/data\/sqlite\/ulogger.db\";/" /var/www/html/config.php
|
sed -i "s/^\$dbdsn = .*$/\$dbdsn = \"sqlite:\/data\/sqlite\/ulogger.db\";/" /var/www/html/config.php
|
||||||
else
|
else
|
||||||
mkdir -p /run/mysqld
|
mkdir -p /run/mysqld /data/mysql
|
||||||
chown mysql:mysql /run/mysqld
|
chown mysql:mysql /run/mysqld /data/mysql
|
||||||
mysql_install_db --user=mysql --datadir=/data
|
mysql_install_db --user=mysql --datadir=/data/mysql
|
||||||
mysqld_safe --datadir=/data &
|
mysqld_safe --datadir=/data/mysql &
|
||||||
mysqladmin --silent --wait=30 ping
|
mysqladmin --silent --wait=30 ping
|
||||||
mysqladmin -u root password "${DB_ROOT_PASS}"
|
mysqladmin -u root password "${DB_ROOT_PASS}"
|
||||||
mysql -u root -p"${DB_ROOT_PASS}" < /var/www/html/scripts/ulogger.mysql
|
mysql -u root -p"${DB_ROOT_PASS}" < /var/www/html/scripts/ulogger.mysql
|
||||||
|
@ -13,9 +13,9 @@ grep '^\$' /var/www/html/config.php
|
|||||||
|
|
||||||
# start services
|
# start services
|
||||||
if [ "$ULOGGER_DB_DRIVER" = "pgsql" ]; then
|
if [ "$ULOGGER_DB_DRIVER" = "pgsql" ]; then
|
||||||
su postgres -c 'pg_ctl -D /data start'
|
su postgres -c 'pg_ctl -D /data/pgsql start'
|
||||||
elif [ "$ULOGGER_DB_DRIVER" = "mysql" ]; then
|
elif [ "$ULOGGER_DB_DRIVER" = "mysql" ]; then
|
||||||
mysqld_safe --datadir=/data &
|
mysqld_safe --datadir=/data/mysql &
|
||||||
fi
|
fi
|
||||||
nginx
|
nginx
|
||||||
php-fpm7 -F
|
php-fpm7 -F
|
||||||
|
@ -34,7 +34,8 @@ before_install:
|
|||||||
sqlite*)
|
sqlite*)
|
||||||
sudo apt-get update -qq
|
sudo apt-get update -qq
|
||||||
sudo apt-get install sqlite3
|
sudo apt-get install sqlite3
|
||||||
mkdir -p /tmp/data/sqlite
|
rm -rf /tmp/data
|
||||||
|
mkdir -p /tmp/data/sqlite /tmp/data/uploads
|
||||||
sqlite3 -init scripts/ulogger.sqlite /tmp/data/sqlite/ulogger.db .exit
|
sqlite3 -init scripts/ulogger.sqlite /tmp/data/sqlite/ulogger.db .exit
|
||||||
sudo chown -R travis:travis /tmp/data
|
sudo chown -R travis:travis /tmp/data
|
||||||
sudo chmod -R 777 /tmp/data
|
sudo chmod -R 777 /tmp/data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user