-
Notifications
You must be signed in to change notification settings - Fork 4k
/
Copy pathentrypoint.sh
35 lines (26 loc) · 901 Bytes
/
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
#!/bin/sh
for file in /iptv-api-config/*; do
filename=$(basename "$file")
target_file="$APP_WORKDIR/config/$filename"
if [ ! -e "$target_file" ]; then
cp -r "$file" "$target_file"
fi
done
. /.venv/bin/activate
crontab -d
if [ -n "$UPDATE_CRON" ]; then
echo "$UPDATE_CRON cd $APP_WORKDIR && /.venv/bin/python main.py >> /tmp/dcron.log 2>&1" | crontab -
fi
# dcron log level
# LOG_EMERG 0 [* system is unusable *]
# LOG_ALERT 1 [* action must be taken immediately *]
# LOG_CRIT 2 [* critical conditions *]
# LOG_ERR 3 [* error conditions *]
# LOG_WARNING 4 [* warning conditions *]
# LOG_NOTICE 5 [* normal but significant condition *]
# LOG_INFO 6 [* informational *]
# LOG_DEBUG 7 [* debug-level messages *]
/usr/sbin/crond -b -L /tmp/dcron.log -l 4 &
nginx -g 'daemon off;' &
python $APP_WORKDIR/main.py &
python -m gunicorn service.app:app -b 0.0.0.0:$APP_PORT --timeout=1000