start.sh 579 B

123456789101112131415161718
  1. #/bin/sh
  2. if [ ! -f /usr/share/nginx/html/conf/config.js ]; then
  3. cp /app/public/conf/config.js /usr/share/nginx/html/conf
  4. fi
  5. if [ $API_URL ]; then
  6. echo "当前 API 地址为: $API_URL"
  7. sed -i "s#http://127.0.0.1:25500#$API_URL#g" /usr/share/nginx/html/conf/config.js
  8. else
  9. echo "当前为默认本地 API 地址: http://127.0.0.1:25500"
  10. echo "如需修改请在容器启动时使用 -e API_URL='https://sub.ops.ci' 传递环境变量"
  11. fi
  12. if [ $SITE_NAME ]; then
  13. sed -i "s#Subconverter Web#$SITE_NAME#g" /usr/share/nginx/html/conf/config.js
  14. fi
  15. nginx -g "daemon off;"