File tree Expand file tree Collapse file tree 6 files changed +26
-6
lines changed Expand file tree Collapse file tree 6 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ COPY scripts/my-ubuntu-source.list /etc/apt/sources.list
8
8
# # Dev related libs
9
9
RUN apt-get update --fix-missing
10
10
11
+ # Time zone
12
+ RUN export DEBIAN_FRONTEND=noninteractive && apt-get install -y tzdata
13
+
11
14
# Nginx
12
15
RUN apt-get install -y nginx
13
16
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ services:
17
17
environment :
18
18
- SEATABLE_THUMBNAIL_SERVER_HOSTNAME=thumbnail.seatable.cn
19
19
- SEATABLE_THUMBNAIL_SERVER_LETSENCRYPT=True
20
+ - TIME_ZONE=Asia/Shanghai
20
21
depends_on :
21
22
- redis
22
23
networks :
Original file line number Diff line number Diff line change 2
2
3
3
set -e
4
4
5
+ # time zone
6
+ if [[ $TIME_ZONE != " " ]]; then
7
+ time_zone=/usr/share/zoneinfo/$TIME_ZONE
8
+ if [[ ! -e $time_zone ]]; then
9
+ echo " invalid time zone"
10
+ exit 1
11
+ else
12
+ ln -snf $time_zone /etc/localtime
13
+ echo " $TIME_ZONE " > /etc/timezone
14
+ fi
15
+ fi
16
+
5
17
# check folder
6
18
if [[ ! -e /shared ]]; then
7
19
echo ' do not find /shared path'
Original file line number Diff line number Diff line change 53
53
54
54
55
55
# logrotate
56
- chmod 0644 /scripts/logrotate-conf/logrotate-cron
57
- /usr/bin/crontab /scripts/logrotate-conf/logrotate-cron
56
+ if [[ -f /var/spool/cron/crontabs/root ]]; then
57
+ cat /scripts/logrotate-conf/logrotate-cron >> /var/spool/cron/crontabs/root
58
+ else
59
+ chmod 0644 /scripts/logrotate-conf/logrotate-cron
60
+ /usr/bin/crontab /scripts/logrotate-conf/logrotate-cron
61
+ fi
58
62
59
63
60
64
# autorun
Original file line number Diff line number Diff line change 12
12
create 644 root root
13
13
sharedscripts
14
14
postrotate
15
+ if [ -f /opt/seatable-thumbnail/pids/seafile.pid ]; then
16
+ kill -USR1 `cat /opt/seatable-thumbnail/pids/seafile.pid`
17
+ fi
18
+
15
19
/scripts/logrotate-conf/seatable-thumbnail-restart.sh
16
20
endscript
17
21
}
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
function stop_server() {
4
- pkill -9 -f seaf-server
5
4
pkill -9 -f uvicorn
6
5
pkill -9 -f multiprocessing
7
6
}
@@ -25,9 +24,6 @@ function start_server() {
25
24
26
25
set_env
27
26
28
- seaf-server -F /opt/seatable-thumbnail/conf -c /opt/seatable-thumbnail/ccnet -d /opt/seatable-thumbnail/seafile-data -l /opt/seatable-thumbnail/logs/seafile.log -L /opt/seatable-thumbnail -P /opt/seatable-thumbnail/pids/seafile.pid - &
29
- sleep 0.2
30
-
31
27
cd /opt/seatable-thumbnail/seatable-thumbnail-server/
32
28
/usr/local/bin/uvicorn main:app --host 127.0.0.1 --port 8088 --workers 4 --access-log --proxy-headers & >> /opt/seatable-thumbnail/logs/seatable-thumbnail.log &
33
29
sleep 0.2
You can’t perform that action at this time.
0 commit comments