aigenai commited on
Commit
f11bb20
·
verified ·
1 Parent(s): e1901a2

Update run.sh

Browse files
Files changed (1) hide show
  1. run.sh +13 -22
run.sh CHANGED
@@ -1,24 +1,15 @@
1
  #!/bin/bash
2
 
3
- # Start PostgreSQL as the postgres user using gosu
4
- gosu postgres whoami && /usr/lib/postgresql/14/bin/pg_ctl -D /var/lib/postgresql/data start && echo"安装完成了?"
5
-
6
- # Jupyter Lab setup
7
- JUPYTER_TOKEN="${JUPYTER_TOKEN:=huggingface}"
8
- echo "Starting Jupyter Lab with token $JUPYTER_TOKEN"
9
-
10
- NOTEBOOK_DIR="/data"
11
-
12
- # Start Jupyter Lab as the user
13
- gosu user jupyter-lab \
14
- --ip 0.0.0.0 \
15
- --port 7860 \
16
- --no-browser \
17
- --allow-root \
18
- --ServerApp.token="$JUPYTER_TOKEN" \
19
- --ServerApp.tornado_settings="{'headers': {'Content-Security-Policy': 'frame-ancestors *'}}" \
20
- --ServerApp.cookie_options="{'SameSite': 'None', 'Secure': True}" \
21
- --ServerApp.disable_check_xsrf=True \
22
- --LabApp.news_url=None \
23
- --LabApp.check_for_updates_class="jupyterlab.NeverCheckForUpdate" \
24
- --notebook-dir=$NOTEBOOK_DIR
 
1
  #!/bin/bash
2
 
3
+ # 启动 PostgreSQL 服务
4
+ docker-entrypoint.sh postgres &
5
+
6
+ # 检查 PostgreSQL 服务是否已启动
7
+ echo "等待 PostgreSQL 服务启动..."
8
+ until pg_isready -h localhost; do
9
+ sleep 2
10
+ done
11
+ echo "PostgreSQL 服务已启动!"
12
+
13
+ # 启动 Flask 应用
14
+ echo "启动 Flask 应用..."
15
+ python3 app.py