-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-entrypoint.sh
33 lines (26 loc) · 938 Bytes
/
docker-entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
[ $DEBUG ] && set -x
if [ "`ls -A /app/zentaopms`" = "" ]; then
cp -a /var/www/zentaopms/* /app/zentaopms
touch /app/zentaopms/www/ok.txt
fi
if [ "`cat /app/zentaopms/VERSION`" != "`cat /var/www/zentaopms/VERSION`" ]; then
cp -a /var/www/zentaopms/* /app/zentaopms
fi
chmod -R 777 /app/zentaopms/www/data
chmod -R 777 /app/zentaopms/tmp
chmod 777 /app/zentaopms/www
chmod 777 /app/zentaopms/config
chmod -R a+rx /app/zentaopms/bin/*
/etc/init.d/apache2 start
chown -R www-data:www-data /app/zentaopms
chown -R mysql:mysql /var/lib/mysql/
if [ "`ls -A /var/lib/mysql/`" = "" ]; then
mysql_install_db --defaults-file=/etc/mysql/my.cnf
/etc/init.d/mysql start
/usr/bin/mysqladmin -uroot password $MYSQL_ROOT_PASSWORD
mysql -uroot -e "UPDATE mysql.user SET plugin='mysql_native_password' WHERE user='root';FLUSH PRIVILEGES;"
else
/etc/init.d/mysql start
fi
tail -f /var/log/apache2/zentao_error_log