NitinBot001 commited on
Commit
21a158f
·
verified ·
1 Parent(s): 04816bd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -13
Dockerfile CHANGED
@@ -1,28 +1,33 @@
 
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /app
4
 
5
- # Install essential dependencies
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
 
8
  git \
9
- curl \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- # Install Node.js and nport
13
- RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
14
- && apt-get install -y nodejs \
15
- && npm install -g nport
16
-
17
- # Python dependencies
18
  COPY requirements.txt .
19
- RUN pip install --no-cache-dir -r requirements.txt
20
 
21
- # Application files
 
 
 
 
 
 
 
 
 
22
  COPY app.py .
23
 
24
- # Hugging Face Spaces requires port 7860
25
  EXPOSE 7860
26
 
27
- # Use gunicorn with timeout
28
- CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "300", "app:app"]
 
1
+ # Use an official Python runtime as a parent image
2
  FROM python:3.10-slim
3
 
4
+ # Set the working directory in the container
5
  WORKDIR /app
6
 
7
+ # Install system dependencies required for llama-cpp-python
8
  RUN apt-get update && apt-get install -y \
9
  build-essential \
10
+ cmake \
11
  git \
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Copy the requirements file into the container
 
 
 
 
 
15
  COPY requirements.txt .
 
16
 
17
+ # Install Python dependencies
18
+ RUN pip install --no-cache-dir -r requirements.txt gunicorn
19
+
20
+ # Install Node.js and nport
21
+ RUN apt-get update && apt-get install -y curl && \
22
+ curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
23
+ apt-get install -y nodejs && \
24
+ npm install -g nport
25
+
26
+ # Copy the application code into the container
27
  COPY app.py .
28
 
29
+ # Expose port 7860 for the Flask app
30
  EXPOSE 7860
31
 
32
+ # Command to run the application using Gunicorn
33
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]