Spaces:
Runtime error
Runtime error
Peter Michael Gits
Claude
Fix Dockerfile directory permissions - create /app as root before switching users
26096f4 Download Dockerfile_fixed from pgits/stt-gpu-service-python-v4: direct link, hf CLI and curl.
- Browser
- Download file 956 Bytes
-
https://huggingface.co/spaces/pgits/stt-gpu-service-python-v4/resolve/main/Dockerfile_fixed
- Command line
-
hf download hf://spaces/pgits/stt-gpu-service-python-v4/Dockerfile_fixed
-
curl -L -o Dockerfile_fixed https://huggingface.co/spaces/pgits/stt-gpu-service-python-v4/resolve/main/Dockerfile_fixed
956 Bytes
| FROM python:3.10-slim | |
| # Set environment variables | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV TRANSFORMERS_CACHE=/app/model_cache | |
| ENV HF_HOME=/app/model_cache | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| ffmpeg \ | |
| libsndfile1 \ | |
| git \ | |
| curl \ | |
| gcc \ | |
| g++ \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create app directory and model cache directory | |
| WORKDIR /app | |
| RUN mkdir -p /app/model_cache | |
| # Copy requirements first for better Docker layer caching | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir --upgrade pip | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application files | |
| COPY app.py . | |
| # Set permissions for model cache | |
| RUN chmod -R 755 /app/model_cache | |
| # Expose port | |
| EXPOSE 7860 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \ | |
| CMD curl -f http://localhost:7860/health || exit 1 | |
| # Run the application | |
| CMD ["python", "app.py"] |