Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +18 -13
Dockerfile
CHANGED
@@ -1,28 +1,33 @@
|
|
|
|
1 |
FROM python:3.10-slim
|
2 |
|
|
|
3 |
WORKDIR /app
|
4 |
|
5 |
-
# Install
|
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 |
-
#
|
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 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
COPY app.py .
|
23 |
|
24 |
-
#
|
25 |
EXPOSE 7860
|
26 |
|
27 |
-
#
|
28 |
-
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "
|
|
|
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"]
|