rakshith commited on
Commit
e42870c
·
1 Parent(s): 095874f

wow plz works

Browse files
Files changed (3) hide show
  1. Dockerfile +3 -3
  2. requirements.txt +2 -1
  3. wsgi.py +12 -0
Dockerfile CHANGED
@@ -13,7 +13,7 @@ COPY . .
13
  RUN mkdir -p logs && chmod 777 logs
14
 
15
  # Expose port
16
- EXPOSE 5000
17
 
18
- # Run the application with uvicorn
19
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
13
  RUN mkdir -p logs && chmod 777 logs
14
 
15
  # Expose port
16
+ EXPOSE 7860
17
 
18
+ # Run the application with uvicorn and WSGI adapter
19
+ CMD ["uvicorn", "wsgi:app", "--host", "0.0.0.0", "--port", "7860"]
requirements.txt CHANGED
@@ -8,4 +8,5 @@ gunicorn==20.1.0
8
  en_core_web_trf @ https://github.com/explosion/spacy-models/releases/download/en_core_web_trf-3.8.0/en_core_web_trf-3.8.0-py3-none-any.whl
9
  thinc==8.3.4
10
  pydantic==2.10.5
11
- typing_extensions==4.12.2
 
 
8
  en_core_web_trf @ https://github.com/explosion/spacy-models/releases/download/en_core_web_trf-3.8.0/en_core_web_trf-3.8.0-py3-none-any.whl
9
  thinc==8.3.4
10
  pydantic==2.10.5
11
+ typing_extensions==4.12.2
12
+ asgiref==3.5.0
wsgi.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from app import app
2
+
3
+ # Add Flask WSGI app to ASGI
4
+ from asgiref.wsgi import WsgiToAsgi
5
+
6
+ # Wrap the Flask app
7
+ app = WsgiToAsgi(app)
8
+
9
+ # For direct running
10
+ if __name__ == "__main__":
11
+ import uvicorn
12
+ uvicorn.run(app, host="0.0.0.0", port=7860)