-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker_entrypoint.sh
63 lines (55 loc) · 1.62 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
set -e
cd /app
if [ ! -e /app/zb_users/c_option.php ]; then
if [ ! -d /app/zb_install ]; then
rm -f /app/index.php
fi
if [ ! -e /app/install-docker.php ]; then
cp /root/install-docker.php /app/install-docker.php
fi
if [ ! -e /app/install-docker-plugins.php ]; then
cp /root/install-docker-plugins.php /app/install-docker-plugins.php
fi
fi
## Download Z-BlogPHP
# ZC_INSTALL_NAME 由 Dockerfile 内定义
if ! [ -e /app/index.php ]; then
echo Downloading Z-BlogPHP...
wget https://update.zblogcn.com/zip/$ZC_INSTALL_NAME.zip
echo Unpacking Z-BlogPHP...
unzip -oq $ZC_INSTALL_NAME.zip
echo Delete zip
rm /app/$ZC_INSTALL_NAME.zip
fi
# # cd /app
# chown -R www-data:www-data /app
# find ./ -type d -print|xargs chmod 777
# find ./ -type f -print|xargs chmod 777
if [ ! -e /app/zb_users/c_option.php ] && [ -e /app/install-docker.php ]; then
echo Installing Z-BlogPHP...
php /app/install-docker.php
fi
if [ "$ZC_SKIP_TC_PLUGINS" -eq "0" ] && [ -e /app/install-docker-plugins.php ]; then
echo Updating Plugins...
php /app/install-docker-plugins.php
fi
if [ -e /app/zb_users/c_option.php ]; then
if [ -d /app/zb_install ]; then
rm -rf /app/zb_install
fi
if [ -e /app/install-docker.php ]; then
rm /app/install-docker.php
fi
if [ -e /app/install-docker-plugins.php ]; then
rm /app/install-docker-plugins.php
fi
fi
if [ "$ZC_SKIP_CHMOD" -eq "0" ]; then
# cd /app
chown -R 1000:1000 /app
find ./ -type d -print|xargs chmod 755
find ./ -type f -print|xargs chmod 644
fi
# echo "$@"
# exec "$@"