Spaces:
Running
Running
Harry-zklcdc
commited on
Commit
·
05fca73
1
Parent(s):
e9b2f99
[Fix] 🤔 Hide NextChat
Browse files- Dockerfile +2 -4
- README.md +1 -1
- app.py +14 -0
- supervisor.conf +11 -0
Dockerfile
CHANGED
@@ -7,7 +7,7 @@ WORKDIR /app
|
|
7 |
|
8 |
COPY . /app
|
9 |
|
10 |
-
RUN apk add curl wget supervisor git
|
11 |
|
12 |
RUN git clone https://github.com/Harry-zklcdc/BingAPI-Demo.git && \
|
13 |
cd BingAPI-Demo && \
|
@@ -22,14 +22,12 @@ RUN curl -L https://github.com/Harry-zklcdc/go-proxy-bingai/releases/latest/down
|
|
22 |
chmod +x go-proxy-bingai && \
|
23 |
rm go-proxy-bingai-linux-amd64.tar.gz
|
24 |
|
25 |
-
COPY supervisor.conf /etc/supervisor/conf.d/supervisor.conf
|
26 |
-
|
27 |
RUN mkdir -p /var/run/supervisor /var/log/supervisor
|
28 |
RUN chown "${USER_ID}:${USER_ID}" /var/run/supervisor /var/log/supervisor
|
29 |
RUN chmod 777 /tmp
|
30 |
|
31 |
USER $USER
|
32 |
|
33 |
-
EXPOSE
|
34 |
|
35 |
CMD /usr/bin/supervisord -c supervisor.conf
|
|
|
7 |
|
8 |
COPY . /app
|
9 |
|
10 |
+
RUN apk add curl wget supervisor git py3-flask
|
11 |
|
12 |
RUN git clone https://github.com/Harry-zklcdc/BingAPI-Demo.git && \
|
13 |
cd BingAPI-Demo && \
|
|
|
22 |
chmod +x go-proxy-bingai && \
|
23 |
rm go-proxy-bingai-linux-amd64.tar.gz
|
24 |
|
|
|
|
|
25 |
RUN mkdir -p /var/run/supervisor /var/log/supervisor
|
26 |
RUN chown "${USER_ID}:${USER_ID}" /var/run/supervisor /var/log/supervisor
|
27 |
RUN chmod 777 /tmp
|
28 |
|
29 |
USER $USER
|
30 |
|
31 |
+
EXPOSE 5000
|
32 |
|
33 |
CMD /usr/bin/supervisord -c supervisor.conf
|
README.md
CHANGED
@@ -6,7 +6,7 @@ colorTo: blue
|
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
license: mit
|
9 |
-
app_port:
|
10 |
---
|
11 |
|
12 |
|
|
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
license: mit
|
9 |
+
app_port: 5000
|
10 |
---
|
11 |
|
12 |
|
app.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from flask import Flask, redirect
|
2 |
+
|
3 |
+
app = Flask(__name__)
|
4 |
+
|
5 |
+
@app.route('/<path:subpath>')
|
6 |
+
def subpath(subpath):
|
7 |
+
return redirect('https://github.com/Harry-zklcdc/go-proxy-bingai/wiki/%E6%BC%94%E7%A4%BA%E7%AB%99', code=302)
|
8 |
+
|
9 |
+
@app.route('/')
|
10 |
+
def index():
|
11 |
+
return redirect('https://github.com/Harry-zklcdc/go-proxy-bingai/wiki/%E6%BC%94%E7%A4%BA%E7%AB%99', code=302)
|
12 |
+
|
13 |
+
if __name__ == '__main__':
|
14 |
+
app.run()
|
supervisor.conf
CHANGED
@@ -16,6 +16,17 @@ supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface
|
|
16 |
[supervisorctl]
|
17 |
serverurl=http://127.0.0.1:9005
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
[program:nextChat]
|
20 |
command=npm run start
|
21 |
directory=/app/BingAPI-Demo
|
|
|
16 |
[supervisorctl]
|
17 |
serverurl=http://127.0.0.1:9005
|
18 |
|
19 |
+
[program:flask]
|
20 |
+
command=flask run --host=0.0.0.0
|
21 |
+
directory=/app
|
22 |
+
stdout_logfile=/dev/stdout
|
23 |
+
stderr_logfile=/dev/stderr
|
24 |
+
autostart=true
|
25 |
+
autorestart=true
|
26 |
+
startsecs=5
|
27 |
+
stopwaitsecs = 5
|
28 |
+
killasgroup=true
|
29 |
+
|
30 |
[program:nextChat]
|
31 |
command=npm run start
|
32 |
directory=/app/BingAPI-Demo
|