This commit is contained in:
wang 2024-07-11 17:33:57 +08:00
parent 056a1e6537
commit 8eb39f2e40
3 changed files with 6 additions and 7 deletions

View File

@ -29,7 +29,7 @@ services:
ports: ports:
- '8000:8000' - '8000:8000'
- '8765:8765' - '8765:8765'
command: gunicorn -w 1 -t 60 -b 0.0.0.0:8000 app:app command: python app.py
code-server: code-server:
build: ./docker/code-server build: ./docker/code-server

View File

@ -39,4 +39,4 @@ COPY --from=build-frontend /usr/src/app/build/ /home/flask/public/
EXPOSE 8000 22 8765 EXPOSE 8000 22 8765
USER root USER root
CMD ["gunicorn", "-w", "1", "-t", "60", "-b", "0.0.0.0:8000", "app:app"] CMD ["python", "app.py"]

View File

@ -4,7 +4,7 @@ import time
import paramiko import paramiko
# from k8s_func import * from k8s_func import *
from teacher_func import * from teacher_func import *
from student_func import * from student_func import *
@ -16,11 +16,10 @@ Payload.max_decode_packets = 500
import logging import logging
import os import os
print(os.getcwd())
logging.basicConfig(level=logging.DEBUG) logging.basicConfig(level=logging.DEBUG)
app = Flask(__name__, static_folder="public") app = Flask(__name__, static_folder="public")
CORS(app) CORS(app)
cors = CORS(app, resource={ cors = CORS(app, resources={
r"/*":{ r"/*":{
"origins":"*" "origins":"*"
} }
@ -453,6 +452,6 @@ def handle_disconnect():
if __name__ == '__main__': if __name__ == '__main__':
socketio.run(app, host='0.0.0.0', port=5000 ,allow_unsafe_werkzeug=True, debug=True) socketio.run(app, host='0.0.0.0', port=8000 ,allow_unsafe_werkzeug=True, debug=False)