Spaces:
Sleeping
Sleeping
Download Dockerfile from shingguy1/Calorie_Estimator: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/spaces/shingguy1/Calorie_Estimator/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/shingguy1/Calorie_Estimator/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/shingguy1/Calorie_Estimator/resolve/main/Dockerfile
1.01 kB
| # Use a Python slim base image with necessary system dependencies | |
| FROM python:3.10-slim | |
| # Install system dependencies for pillow and general compatibility | |
| RUN apt-get update && apt-get install -y \ | |
| libpng-dev \ | |
| libjpeg-dev \ | |
| gcc \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy requirements and install dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the Streamlit app file (in src directory) | |
| COPY src/streamlit_app.py ./src/streamlit_app.py | |
| # Create cache directory with write permissions | |
| RUN mkdir -p /tmp/cache && chmod -R 777 /tmp/cache | |
| # Expose Streamlit's default port | |
| EXPOSE 8501 | |
| # Set environment variable for Hugging Face cache | |
| ENV HUGGINGFACE_HUB_CACHE=/tmp/cache | |
| # Run Streamlit with the correct file path, increased upload size, and disabled XSRF protection | |
| CMD ["streamlit", "run", "src/streamlit_app.py", "--server.maxUploadSize=1000", "--server.port=8501", "--server.enableXsrfProtection=false"] |