tyrwh commited on
Commit
1342ec2
·
1 Parent(s): 091f8cc

Dockerfile updates - still no gunicorn

Browse files
Files changed (4) hide show
  1. .gitignore +1 -1
  2. Dockerfile +2 -4
  3. app.py +1 -1
  4. requirements.txt +1 -1
.gitignore CHANGED
@@ -4,4 +4,4 @@ weights_nemaquant.v1.onnx
4
  results/
5
  *.pyc
6
  annotated/
7
- uploads/
 
4
  results/
5
  *.pyc
6
  annotated/
7
+ uploads/
Dockerfile CHANGED
@@ -6,12 +6,11 @@ WORKDIR /app
6
 
7
  # Install system dependencies required by OpenCV and other packages, plus Redis
8
  RUN apt-get update && apt-get install -y --no-install-recommends \
9
- libgl1-mesa-glx \
10
  libglib2.0-0 \
11
  libsm6 \
12
  libxrender1 \
13
  libxext6 \
14
- redis-server \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
  # Copy the requirements file into the container at /app
@@ -42,5 +41,4 @@ EXPOSE 7860
42
  # Use gunicorn for production deployment if preferred over Flask's development server
43
  # CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
44
  # For simplicity during development and typical HF Spaces use:
45
- # Start Redis server in background and then start the Flask app
46
- CMD redis-server --daemonize yes && python app.py
 
6
 
7
  # Install system dependencies required by OpenCV and other packages, plus Redis
8
  RUN apt-get update && apt-get install -y --no-install-recommends \
9
+ libgl1 \
10
  libglib2.0-0 \
11
  libsm6 \
12
  libxrender1 \
13
  libxext6 \
 
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
  # Copy the requirements file into the container at /app
 
41
  # Use gunicorn for production deployment if preferred over Flask's development server
42
  # CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
43
  # For simplicity during development and typical HF Spaces use:
44
+ CMD python app.py
 
app.py CHANGED
@@ -14,7 +14,7 @@ from ultralytics.utils import ThreadingLocked
14
  import numpy as np
15
  import pandas as pd
16
  from torch import cuda
17
- from flask import Flask, Response, render_template, request, jsonify, send_from_directory, send_file, session, redirect, url_for
18
  from multiprocessing.pool import Pool
19
  from pathlib import Path
20
  from PIL import Image
 
14
  import numpy as np
15
  import pandas as pd
16
  from torch import cuda
17
+ from flask import Flask, Response, render_template, request, jsonify, send_file, session
18
  from multiprocessing.pool import Pool
19
  from pathlib import Path
20
  from PIL import Image
requirements.txt CHANGED
@@ -3,7 +3,7 @@ numpy==2.2.6
3
  opencv_python==4.12.0.88
4
  pandas==2.3.1
5
  Pillow==11.3.0
6
- redis==6.2.0
7
  torch==2.7.1
8
  ultralytics==8.3.170
9
  Werkzeug==3.1.3
 
 
3
  opencv_python==4.12.0.88
4
  pandas==2.3.1
5
  Pillow==11.3.0
 
6
  torch==2.7.1
7
  ultralytics==8.3.170
8
  Werkzeug==3.1.3
9
+ gunicorn==21.2.0