Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +5 -14
Dockerfile
CHANGED
|
@@ -2,30 +2,21 @@ FROM python:3.9-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
ENV TRANSFORMERS_CACHE=/tmp/huggingface-cache \
|
| 7 |
-
NUMBA_CACHE_DIR=/tmp/numba-cache \
|
| 8 |
-
HF_HOME=/tmp/huggingface-home
|
| 9 |
-
|
| 10 |
-
# Install system dependencies with cleanup
|
| 11 |
RUN apt-get update && \
|
| 12 |
-
apt-get install -y --no-install-recommends gcc
|
| 13 |
rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
-
# Install Python dependencies with pinned numpy version
|
| 16 |
COPY requirements.txt .
|
| 17 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
-
mkdir -p ${TRANSFORMERS_CACHE} && \
|
| 19 |
-
chmod 777 ${TRANSFORMERS_CACHE}
|
| 20 |
|
| 21 |
# Copy application code
|
| 22 |
COPY app.py text2generation.py ./
|
| 23 |
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
-
# Health check
|
| 27 |
-
HEALTHCHECK --interval=30s --timeout=30s --start-period=
|
| 28 |
CMD curl -f http://localhost:7860/health || exit 1
|
| 29 |
|
| 30 |
-
# Run with Flask directly (no Gunicorn issues)
|
| 31 |
CMD ["python", "app.py"]
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
RUN apt-get update && \
|
| 7 |
+
apt-get install -y --no-install-recommends gcc && \
|
| 8 |
rm -rf /var/lib/apt/lists/*
|
| 9 |
|
|
|
|
| 10 |
COPY requirements.txt .
|
| 11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
| 12 |
|
| 13 |
# Copy application code
|
| 14 |
COPY app.py text2generation.py ./
|
| 15 |
|
| 16 |
EXPOSE 7860
|
| 17 |
|
| 18 |
+
# Health check
|
| 19 |
+
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
|
| 20 |
CMD curl -f http://localhost:7860/health || exit 1
|
| 21 |
|
|
|
|
| 22 |
CMD ["python", "app.py"]
|