-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Expand file tree
/
Copy pathentrypoint.sh
More file actions
27 lines (20 loc) · 703 Bytes
/
entrypoint.sh
File metadata and controls
27 lines (20 loc) · 703 Bytes
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
#!/bin/sh
set -e
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
. $APP_WORKDIR/.venv/bin/activate
: "${APP_PORT:=$APP_PORT}"
: "${NGINX_HTTP_PORT:=$NGINX_HTTP_PORT}"
: "${NGINX_RTMP_PORT:=$NGINX_RTMP_PORT}"
sed -e "s/\${APP_PORT}/${APP_PORT}/g" \
-e "s/\${NGINX_HTTP_PORT}/${NGINX_HTTP_PORT}/g" \
-e "s/\${NGINX_RTMP_PORT}/${NGINX_RTMP_PORT}/g" \
/etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
nginx -g 'daemon off;' &
python -u $APP_WORKDIR/main.py &
exec python -u -m gunicorn service.app:app -b 127.0.0.1:$APP_PORT --timeout=1000