forked from Guovin/iptv-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
31 lines (24 loc) · 963 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
#!/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 -l ; \
if [ -n "$UPDATE_CRON1" ]; then echo "$UPDATE_CRON1 cd $APP_WORKDIR && /.venv/bin/python main.py"; fi; \
if [ -n "$UPDATE_CRON2" ]; then echo "$UPDATE_CRON2 cd $APP_WORKDIR && /.venv/bin/python main.py"; fi) | crontab -
# 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 &
python $APP_WORKDIR/main.py &
python -m gunicorn service.app:app -b 0.0.0.0:$APP_PORT --timeout=1000