# Space not working as expected

**URL:** <https://discuss.huggingface.co/t/space-not-working-as-expected/135296>\
**Category:** Spaces\
**Created:** [January 11, 2025, 6:53pm UTC](https://discuss.huggingface.co/t/space-not-working-as-expected/135296 "2025-01-11T18:53:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishalsh13](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/vishalsh13/32/38983_2.png) [@vishalsh13](https://discuss.huggingface.co/u/vishalsh13)\
**Post date:** [January 11, 2025, 6:53pm UTC](https://discuss.huggingface.co/t/space-not-working-as-expected/135296/1 "2025-01-11T18:53:47Z")

</div>

sentence-transformer working locally however not when deployed docker container on Hugging Face even after successful built how always shows starting status and then timeout after 30 min facing the issue for last few days shows following for a long time. Any help in following is welcome or way to trouble shoot is also good for way ahead

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/a/2/a2a640364ca0c537a0232a3b90d425af98516a43.png)

Locally its working fine without docker and for Hugging Face my Dockerfile is as below  
#Use the official Python 3.10 slim image  
FROM python:3.10.11-slim

#Set environment variables  
ENV DEBIAN\_FRONTEND=noninteractive  
ENV PYTHONUNBUFFERED=1

#Install basic build tools and libraries (required by faiss-cpu, PyMuPDF, etc.)  
RUN apt-get update && apt-get install -y --no-install-recommends   
build-essential   
cmake   
libopenblas-dev   
libomp-dev   
poppler-utils   
&& rm -rf /var/lib/apt/lists/\*

#Create a working directory  
WORKDIR /app

#Set Hugging Face cache directory  
ENV HF\_HOME=/app/cache  
RUN mkdir -p /app/cache && chmod -R 777 /app/cache

#Copy requirements first (for Docker layer caching)  
COPY requirements.txt .

#Install Python dependencies (no version pinning)  
RUN pip install --no-cache-dir -r requirements.txt

#Create directories with proper read/write permissions  
RUN mkdir -p /app/uploads/vectors && chmod -R 777 /app/uploads

#Copy the rest of the application files  
COPY . .

#Expose the port used by your Flask app (e.g., 7860)  
EXPOSE 7860

#Start the Flask app  
#CMD [“python”, “run.py”]  
#Run Gunicorn  
CMD [“gunicorn”, “–bind”, “0.0.0.0:7860”, “wsgi:obj\_app”]

---

<div class="post-metadata">

**Author:** ![vishalsh13](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/vishalsh13/32/38983_2.png) [@vishalsh13](https://discuss.huggingface.co/u/vishalsh13)\
**Post date:** [January 11, 2025, 6:57pm UTC](https://discuss.huggingface.co/t/space-not-working-as-expected/135296/2 "2025-01-11T18:57:19Z")

</div>

this is error i got after 30 min

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/5/c/5c415432889255f85b1afa524913f488e9f3cf0a.png)
