vinay0123 commited on
Commit
32efecf
·
verified ·
1 Parent(s): efba25f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -15
Dockerfile CHANGED
@@ -8,28 +8,25 @@ ENV OPENBLAS_NUM_THREADS=1
8
  ENV VECLIB_MAXIMUM_THREADS=1
9
  ENV NUMEXPR_NUM_THREADS=1
10
 
 
 
 
 
 
11
  WORKDIR /app
12
 
13
- # Install system dependencies
14
- RUN apt-get update && apt-get install -y \
15
- gcc \
16
- git \
17
- build-essential \
18
  && rm -rf /var/lib/apt/lists/*
19
 
20
- # Copy requirements first for better caching
21
- COPY requirements.txt /app/
22
  RUN pip install --no-cache-dir -r requirements.txt
23
 
24
- # Copy the rest of the application
25
- COPY . /app
26
-
27
- # Set environment variables for PyTorch
28
- ENV TORCH_CUDA_VERSION=cu118
29
- ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
30
- ENV PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:512
31
 
32
  EXPOSE 7860
33
 
34
- # Run with multiple workers for better CPU utilization
35
  CMD ["python", "app.py"]
 
 
8
  ENV VECLIB_MAXIMUM_THREADS=1
9
  ENV NUMEXPR_NUM_THREADS=1
10
 
11
+ FROM python:3.10-slim
12
+
13
+ ENV PYTHONDONTWRITEBYTECODE=1
14
+ ENV PYTHONUNBUFFERED=1
15
+
16
  WORKDIR /app
17
 
18
+ COPY requirements.txt /app/
19
+ COPY . /app
20
+
21
+ RUN apt-get update && apt-get install -y gcc git \
 
22
  && rm -rf /var/lib/apt/lists/*
23
 
 
 
24
  RUN pip install --no-cache-dir -r requirements.txt
25
 
26
+ # Download spacy English model
27
+ RUN python -m spacy download en_core_web_sm
 
 
 
 
 
28
 
29
  EXPOSE 7860
30
 
 
31
  CMD ["python", "app.py"]
32
+