dan92 commited on
Commit
6757fc3
·
verified ·
1 Parent(s): 387ad2d

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +10 -7
  2. entrypoint.sh +12 -0
Dockerfile CHANGED
@@ -1,7 +1,10 @@
1
- FROM hpyp/bbapi:latest
2
-
3
- ENV APP_SECRET=8001
4
-
5
- EXPOSE 8001
6
-
7
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8001"]
 
 
 
 
1
+ FROM hpyp/bbapi:latest
2
+
3
+ ENV APP_SECRET=8001
4
+
5
+ EXPOSE 8001
6
+
7
+ COPY entrypoint.sh /entrypoint.sh
8
+ RUN chmod +x /entrypoint.sh
9
+
10
+ ENTRYPOINT ["/entrypoint.sh"]
entrypoint.sh ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # 网络检查
4
+ echo "正在检查网络连接..."
5
+ if nc -z -w 5 www.blackbox.ai 443; then
6
+ echo "成功连接到blackbox.ai"
7
+ else
8
+ echo "无法连接到blackbox.ai,请检查网络配置"
9
+ fi
10
+
11
+ # 启动应用
12
+ exec uvicorn main:app --host 0.0.0.0 --port 8001