Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +5 -10
Dockerfile
CHANGED
|
@@ -1,25 +1,20 @@
|
|
| 1 |
-
# Use a lightweight production-ready Python image
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
# Set working directory inside the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Install system
|
| 8 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 9 |
build-essential \
|
|
|
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
-
# Copy requirements file first to leverage caching layers
|
| 13 |
COPY requirements.txt .
|
| 14 |
-
|
| 15 |
-
# Install Python packages
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
-
# Copy all project folders and files to the container
|
| 19 |
COPY . .
|
| 20 |
|
| 21 |
-
|
| 22 |
EXPOSE 7860
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
CMD ["gunicorn", "--bind", "0.0.0.0:7860"
|
|
|
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install the actual system level whois binary so the python library doesn't crash
|
| 6 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
build-essential \
|
| 8 |
+
whois \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
|
|
|
| 11 |
COPY requirements.txt .
|
|
|
|
|
|
|
| 12 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
|
|
|
| 14 |
COPY . .
|
| 15 |
|
| 16 |
+
ENV PORT=7860
|
| 17 |
EXPOSE 7860
|
| 18 |
|
| 19 |
+
# Added --timeout 120 to allow up to 2 minutes for heavy ML models to load smoothly
|
| 20 |
+
CMD ["gunicorn", "app:app", "--workers", "1", "--timeout", "120", "--bind", "0.0.0.0:7860"]
|