File size: 798 Bytes
8e67882
11ad9da
 
6b88e8c
5459f30
 
11ad9da
6b88e8c
11ad9da
cf2bca5
11ad9da
 
0e8c893
 
11ad9da
86389c5
 
cf2bca5
11ad9da
86389c5
 
11ad9da
5459f30
b301879
0e8c893
6b88e8c
cf2bca5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 1. Base Image
FROM python:3.11-slim

# 2. Set environment variables for a non-interactive server
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

# 3. Install the single critical system dependency for OpenCV
RUN apt-get update && apt-get install -y --no-install-recommends \
    libgl1 \
    && rm -rf /var/lib/apt/lists/*

# 4. Set the working directory
WORKDIR /app

# 5. Copy and install Python requirements
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# 6. Copy the rest of the application
COPY . .

# 7. Expose the correct Hugging Face Space port
EXPOSE 7860

# 8. Entrypoint with all necessary flags to prevent permission and connection errors
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true"]