sreepathi-ravikumar commited on
Commit
d1cdf2e
·
verified ·
1 Parent(s): 39fc874

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -6
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # Stage 1: Builder for model caching
2
  FROM python:3.9-slim as builder
3
 
4
  WORKDIR /app
@@ -6,10 +6,9 @@ COPY requirements.txt .
6
 
7
  RUN apt-get update && \
8
  apt-get install -y --no-install-recommends gcc python3-dev && \
9
- pip install --user -r requirements.txt && \
10
- python -c "from transformers import pipeline; pipeline('text-generation', model='tiiuae/falcon-7b-instruct')"
11
 
12
- # Stage 2: Runtime image
13
  FROM python:3.9-slim
14
 
15
  WORKDIR /app
@@ -31,5 +30,4 @@ EXPOSE 7860
31
  HEALTHCHECK --interval=30s --timeout=30s --start-period=120s --retries=3 \
32
  CMD curl -f http://localhost:7860/health || exit 1
33
 
34
- # Use gunicorn with 2 workers (optimal for HF Spaces)
35
- CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "2", "--timeout", "120", "app:app"]
 
1
+ # Stage 1: Builder
2
  FROM python:3.9-slim as builder
3
 
4
  WORKDIR /app
 
6
 
7
  RUN apt-get update && \
8
  apt-get install -y --no-install-recommends gcc python3-dev && \
9
+ pip install --user -r requirements.txt
 
10
 
11
+ # Stage 2: Runtime
12
  FROM python:3.9-slim
13
 
14
  WORKDIR /app
 
30
  HEALTHCHECK --interval=30s --timeout=30s --start-period=120s --retries=3 \
31
  CMD curl -f http://localhost:7860/health || exit 1
32
 
33
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "1", "--timeout", "120", "app:app"]