Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -10
Dockerfile
CHANGED
|
@@ -1,10 +1,8 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
|
| 4 |
-
RUN mkdir -p /data/model /data/repo && \
|
| 5 |
-
chmod -R a+rwx /data
|
| 6 |
|
| 7 |
-
#
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
build-essential \
|
| 10 |
git \
|
|
@@ -12,17 +10,19 @@ RUN apt-get update && apt-get install -y \
|
|
| 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
|
| 24 |
COPY app.py .
|
| 25 |
|
| 26 |
-
# Hugging Face Spaces
|
| 27 |
EXPOSE 7860
|
| 28 |
-
|
|
|
|
|
|
|
|
|
| 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 \
|
|
|
|
| 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"]
|