| # Hugging Face Docker Space — Hostel Management System | |
| # Docs: https://huggingface.co/docs/hub/spaces-sdks-docker | |
| FROM python:3.11-slim | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| gcc g++ libgomp1 curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN useradd -m -u 1000 user | |
| WORKDIR /app | |
| COPY --chown=user:user requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| COPY --chown=user:user . . | |
| # Compile C PDC benchmark backend (OpenMP + pthreads) | |
| RUN cd c_backend && \ | |
| gcc -O2 -fopenmp -pthread search_bench.c hostel_mock_data.c -o search_bench -lm && \ | |
| chown user:user search_bench | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH="/home/user/.local/bin:$PATH" | |
| EXPOSE 7860 | |
| HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health || exit 1 | |
| CMD ["streamlit", "run", "app.py", \ | |
| "--server.port=7860", \ | |
| "--server.address=0.0.0.0", \ | |
| "--server.headless=true", \ | |
| "--server.enableCORS=false", \ | |
| "--server.enableXsrfProtection=false", \ | |
| "--server.fileWatcherType=none"] | |