WebashalarForML commited on
Commit
15a742d
·
verified ·
1 Parent(s): 7f8855a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -2
Dockerfile CHANGED
@@ -51,6 +51,7 @@ RUN mkdir -p uploads results checkpoints temp \
51
  # Ensure the entire app directory is writable
52
  RUN chmod -R 777 /app
53
 
 
54
  # Expose the inference port
55
  EXPOSE 7860
56
 
@@ -58,5 +59,13 @@ EXPOSE 7860
58
  ENV FLASK_APP=app.py \
59
  FLASK_ENV=production
60
 
61
- # Launch with Gunicorn (1 worker, sync, 30s timeout)
62
- CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
 
 
 
 
 
 
 
 
 
51
  # Ensure the entire app directory is writable
52
  RUN chmod -R 777 /app
53
 
54
+ # Expose the inference port
55
  # Expose the inference port
56
  EXPOSE 7860
57
 
 
59
  ENV FLASK_APP=app.py \
60
  FLASK_ENV=production
61
 
62
+ # Launch with Gunicorn:
63
+ # - gthread: threaded worker class
64
+ # - threads=2: two threads per worker
65
+ # - timeout=600: 10-minute timeout to cover long inferences
66
+ CMD ["gunicorn", \
67
+ "--worker-class", "gthread", \
68
+ "--threads", "2", \
69
+ "--timeout", "600", \
70
+ "--bind", "0.0.0.0:7860", \
71
+ "app:app"]