Spaces:
Sleeping
Sleeping
Download Dockerfile from omm7/hbcp: direct link, hf CLI and curl.
- Browser
- Download file 931 Bytes
-
https://huggingface.co/spaces/omm7/hbcp/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/omm7/hbcp/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/omm7/hbcp/resolve/main/Dockerfile
931 Bytes
| # Use a Python base image with a stable version | |
| FROM python:3.9 | |
| # Set the working directory inside the container | |
| WORKDIR /app | |
| # Copy dependency files first for better Docker caching | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the application logic and the serialized model file | |
| COPY app.py . | |
| # Ensure this file name matches the joblib dump file name | |
| COPY hotel_cancellation_prediction_model_v1_0.joblib . | |
| # Recommended security practice | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| WORKDIR $HOME/app | |
| COPY --chown=user . $HOME/app | |
| # Define the command to run the Streamlit app on port "7860" | |
| # and explicitly disable XSRF protection (critical for Hugging Face Spaces file uploads) | |
| CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"] | |