Files changed (1) hide show
  1. Dockerfile +15 -4
Dockerfile CHANGED
@@ -1,11 +1,22 @@
1
  FROM python:3.9
2
  WORKDIR /code
3
  COPY ./requirements.txt /code/requirements.txt
 
 
 
 
 
 
 
 
 
4
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
5
- RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
6
- RUN apt-get install git-lfs && git lfs install
7
  RUN git clone https://huggingface.co/sentence-transformers/quora-distilbert-multilingual model
 
8
  COPY . .
9
  ENV PYTHONPATH "${PYTHONPATH}:/code/app/"
10
- # CMD ["uwsgi", "--http", "0.0.0.0:7860", "--master", "-p", "1", "-w", "app.main:app"]
11
- CMD ["python3", "app/main.py"]
 
 
1
  FROM python:3.9
2
  WORKDIR /code
3
  COPY ./requirements.txt /code/requirements.txt
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && \
7
+ apt-get install -y curl && \
8
+ curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
9
+ apt-get install git-lfs && \
10
+ git lfs install
11
+
12
+ # Install Python dependencies
13
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
14
+
15
+ # Download model
16
  RUN git clone https://huggingface.co/sentence-transformers/quora-distilbert-multilingual model
17
+
18
  COPY . .
19
  ENV PYTHONPATH "${PYTHONPATH}:/code/app/"
20
+
21
+ # Use Uvicorn for async SSE support with Gradio
22
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]