vinay0123 commited on
Commit
646badf
·
verified ·
1 Parent(s): 38dc4d9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -9
Dockerfile CHANGED
@@ -1,34 +1,37 @@
1
  FROM python:3.9-slim
2
 
3
- # Install system dependencies for building Python packages
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
  build-essential \
6
  gcc \
 
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
  # Set working directory
10
  WORKDIR /app
11
 
12
- # Install blis separately to avoid long build times
13
- RUN pip install --no-cache-dir blis==0.7.9
 
 
14
 
15
- # Copy requirements and install Python dependencies
16
  COPY requirements.txt .
17
  RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
18
 
19
- # Download spaCy language model
20
  RUN python -m spacy download en_core_web_sm
21
 
22
- # Copy the rest of your app
23
  COPY . .
24
 
25
- # Expose the port expected by Hugging Face Spaces (7860 or 5000)
26
  EXPOSE 7860
27
 
28
- # Set Flask environment variables
29
  ENV FLASK_APP=app.py
30
  ENV FLASK_RUN_PORT=7860
31
  ENV FLASK_RUN_HOST=0.0.0.0
32
 
33
- # Run the Flask app
34
  CMD ["flask", "run"]
 
1
  FROM python:3.9-slim
2
 
3
+ # System dependencies required for Python packages
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
  build-essential \
6
  gcc \
7
+ curl \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
  # Set working directory
11
  WORKDIR /app
12
 
13
+ # Install blis and googletrans separately to avoid building from source
14
+ RUN pip install --no-cache-dir --prefer-binary \
15
+ blis==0.7.9 \
16
+ googletrans==4.0.0rc1
17
 
18
+ # Copy requirements and install remaining dependencies
19
  COPY requirements.txt .
20
  RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
21
 
22
+ # Download spaCy model
23
  RUN python -m spacy download en_core_web_sm
24
 
25
+ # Copy your application
26
  COPY . .
27
 
28
+ # Expose required port
29
  EXPOSE 7860
30
 
31
+ # Flask environment config
32
  ENV FLASK_APP=app.py
33
  ENV FLASK_RUN_PORT=7860
34
  ENV FLASK_RUN_HOST=0.0.0.0
35
 
36
+ # Run the Flask server
37
  CMD ["flask", "run"]