zhangshibo commited on
Commit
994cdb2
·
1 Parent(s): a5aa58d
Files changed (1) hide show
  1. Dockerfile +16 -1
Dockerfile CHANGED
@@ -1,7 +1,22 @@
 
 
 
 
 
 
 
1
  FROM snailyp/blackbox2api
2
 
3
  ENV APP_SECRET=${APP_SECRET}
4
 
5
  EXPOSE 7860
6
 
7
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
1
+ #FROM snailyp/blackbox2api
2
+ #
3
+ #ENV APP_SECRET=${APP_SECRET}
4
+ #
5
+ #EXPOSE 7860
6
+ #
7
+ #CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
8
  FROM snailyp/blackbox2api
9
 
10
  ENV APP_SECRET=${APP_SECRET}
11
 
12
  EXPOSE 7860
13
 
14
+ # ��װ curl�����δ��װ��
15
+ RUN apt-get update && apt-get install -y curl
16
+
17
+ # ��������ű� keep_alive.sh
18
+ RUN echo '#!/bin/bash\nwhile true; do curl -m 5 http://localhost:7860 > /dev/null 2>&1; sleep 1800; done' > /keep_alive.sh
19
+ RUN chmod +x /keep_alive.sh
20
+
21
+ # �������б���ű���Ӧ�ó���
22
+ CMD ["/bin/bash", "-c", "/keep_alive.sh & uvicorn main:app --host 0.0.0.0 --port 7860"]