Alizmoh98 commited on
Commit
eb684c9
·
1 Parent(s): e8e33af

fixed dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -8
Dockerfile CHANGED
@@ -1,20 +1,21 @@
1
  FROM python:3.11
2
 
3
- # Set working directory
4
  WORKDIR /code
5
 
6
- # Copy requirements and install
7
- COPY ./requirements.txt /code/requirements.txt
 
8
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
9
 
10
- # Install system dependencies for OpenCV (YOLO usually needs this)
11
- RUN apt-get update && apt-get install -y libgl1-mesa-glx
12
 
13
- # Copy your source code
14
  COPY ./src /code/src
15
 
16
- # Create a directory for boxes if it doesn't exist (permissions fix)
17
  RUN mkdir -p /code/src/boxes && chmod 777 /code/src/boxes
18
 
19
- # Hugging Face Spaces expects the app to run on port 7860
20
  CMD ["uvicorn", "src.app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.11
2
 
3
+ # 1) Workdir
4
  WORKDIR /code
5
 
6
+ # 2) Copy requirements and install Python deps
7
+ COPY requirements.txt /code/requirements.txt
8
+ RUN pip install --no-cache-dir --upgrade pip
9
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
10
 
11
+ # 3) Install system deps needed by OpenCV etc. (no mesa-glx here)
12
+ RUN apt-get update && apt-get install -y libgl1 libglib2.0-0
13
 
14
+ # 4) Copy your source code
15
  COPY ./src /code/src
16
 
17
+ # 5) (Optional) Ensure boxes dir exists; your code also creates it, so this is just extra safety
18
  RUN mkdir -p /code/src/boxes && chmod 777 /code/src/boxes
19
 
20
+ # 6) Start FastAPI+Gradio app
21
  CMD ["uvicorn", "src.app:app", "--host", "0.0.0.0", "--port", "7860"]