Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +14 -11
Dockerfile
CHANGED
@@ -1,25 +1,28 @@
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
-
|
|
|
|
|
4 |
|
|
|
5 |
RUN apt-get update && apt-get install -y \
|
6 |
build-essential \
|
7 |
-
cmake \
|
8 |
git \
|
9 |
curl \
|
10 |
&& rm -rf /var/lib/apt/lists/*
|
11 |
|
12 |
-
|
|
|
|
|
|
|
13 |
|
|
|
|
|
14 |
RUN pip install --no-cache-dir -r requirements.txt
|
15 |
|
16 |
-
|
17 |
-
&& apt-get install -y nodejs \
|
18 |
-
&& npm install -g nport
|
19 |
-
|
20 |
COPY app.py .
|
21 |
-
COPY wsgi.py .
|
22 |
-
|
23 |
-
EXPOSE 5000
|
24 |
|
25 |
-
|
|
|
|
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
+
# Create persistent storage directory
|
4 |
+
RUN mkdir -p /data/model /data/repo && \
|
5 |
+
chmod -R a+rwx /data
|
6 |
|
7 |
+
# System dependencies
|
8 |
RUN apt-get update && apt-get install -y \
|
9 |
build-essential \
|
|
|
10 |
git \
|
11 |
curl \
|
12 |
&& rm -rf /var/lib/apt/lists/*
|
13 |
|
14 |
+
# Install Node.js and nport
|
15 |
+
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
|
16 |
+
apt-get install -y nodejs && \
|
17 |
+
npm install -g nport
|
18 |
|
19 |
+
# Python dependencies
|
20 |
+
COPY requirements.txt .
|
21 |
RUN pip install --no-cache-dir -r requirements.txt
|
22 |
|
23 |
+
# Application code
|
|
|
|
|
|
|
24 |
COPY app.py .
|
|
|
|
|
|
|
25 |
|
26 |
+
# Hugging Face Spaces configuration
|
27 |
+
EXPOSE 7860
|
28 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "600", "app:app"]
|