Spaces:
Running
Running
Download Dockerfile from 78anand/KasaHealth: direct link, hf CLI and curl.
- Browser
- Download file 1.45 kB
-
https://huggingface.co/spaces/78anand/KasaHealth/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/78anand/KasaHealth/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/78anand/KasaHealth/resolve/main/Dockerfile
1.45 kB
| # Use an official Python runtime as a parent image | |
| FROM python:3.10-slim | |
| # Set environment variables | |
| ENV PYTHONDONTWRITEBYTECODE 1 | |
| ENV PYTHONUNBUFFERED 1 | |
| ENV HOME=/tmp | |
| ENV HF_HOME=/tmp/huggingface | |
| ENV XDG_CACHE_HOME=/tmp/cache | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Install system dependencies for librosa and audio processing | |
| RUN apt-get update && apt-get install -y \ | |
| libsndfile1 \ | |
| ffmpeg \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy the requirements file into the container | |
| COPY requirements_render.txt . | |
| # Install dependencies | |
| RUN pip install --no-cache-dir -r requirements_render.txt | |
| # Copy the entire project into the container | |
| COPY . . | |
| # Create necessary directories in /tmp and set permissions | |
| RUN mkdir -p /tmp/huggingface /tmp/cache /tmp/matplotlib /tmp/numba /app/app/tmp/uploads && \ | |
| chmod -R 777 /tmp /app/app/tmp/uploads | |
| # Expose the port Render/HF uses | |
| EXPOSE 7860 | |
| # Ensure the app user has permissions | |
| RUN chown -R 1000:1000 /app | |
| USER 1000 | |
| # Set PYTHONPATH so 'utils' can be found easily | |
| ENV PYTHONPATH=/app | |
| # Command to run the application | |
| # We run from the root /app and point to app.main:app | |
| # Increased timeout to 300 to handle slow TensorFlow initialization on Free plans | |
| CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "300", "--workers", "1", "--log-level", "debug", "--error-logfile", "-", "--access-logfile", "-", "app.main:app"] | |