Spaces:
Runtime error
Runtime error
Fix v1.1.3: Dockerfile - Remove complex deps causing wget/openvscode error
Browse files- Dockerfile +8 -26
Dockerfile
CHANGED
|
@@ -1,43 +1,25 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
|
| 4 |
-
ENV PYTHONUNBUFFERED=1
|
| 5 |
-
ENV TRANSFORMERS_CACHE=/app/model_cache
|
| 6 |
-
ENV HF_HOME=/app/model_cache
|
| 7 |
|
| 8 |
-
# Install system dependencies
|
| 9 |
RUN apt-get update && apt-get install -y \
|
| 10 |
-
ffmpeg \
|
| 11 |
-
libsndfile1 \
|
| 12 |
-
git \
|
| 13 |
curl \
|
| 14 |
-
gcc \
|
| 15 |
-
g++ \
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
WORKDIR /app
|
| 20 |
-
RUN mkdir -p /app/model_cache
|
| 21 |
-
|
| 22 |
-
# Copy requirements first for better Docker layer caching
|
| 23 |
COPY requirements.txt .
|
| 24 |
-
|
| 25 |
-
# Install Python dependencies
|
| 26 |
-
RUN pip install --no-cache-dir --upgrade pip
|
| 27 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 28 |
|
| 29 |
-
# Copy application
|
| 30 |
COPY app.py .
|
| 31 |
|
| 32 |
-
# Set permissions for model cache
|
| 33 |
-
RUN chmod -R 755 /app/model_cache
|
| 34 |
-
|
| 35 |
# Expose port
|
| 36 |
EXPOSE 7860
|
| 37 |
|
| 38 |
-
#
|
| 39 |
-
HEALTHCHECK --interval=30s --timeout=
|
| 40 |
CMD curl -f http://localhost:7860/health || exit 1
|
| 41 |
|
| 42 |
-
# Run
|
| 43 |
-
CMD ["python", "app.py"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
+
# Install minimal system dependencies
|
| 6 |
RUN apt-get update && apt-get install -y \
|
|
|
|
|
|
|
|
|
|
| 7 |
curl \
|
|
|
|
|
|
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
+
# Copy requirements and install Python dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
COPY requirements.txt .
|
|
|
|
|
|
|
|
|
|
| 12 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
| 14 |
+
# Copy application
|
| 15 |
COPY app.py .
|
| 16 |
|
|
|
|
|
|
|
|
|
|
| 17 |
# Expose port
|
| 18 |
EXPOSE 7860
|
| 19 |
|
| 20 |
+
# Simple health check
|
| 21 |
+
HEALTHCHECK --interval=30s --timeout=30s --start-period=60s --retries=3 \
|
| 22 |
CMD curl -f http://localhost:7860/health || exit 1
|
| 23 |
|
| 24 |
+
# Run application
|
| 25 |
+
CMD ["python", "app.py"]
|