ALYYAN commited on
Commit
11ad9da
·
verified ·
1 Parent(s): f1c86a4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -12
Dockerfile CHANGED
@@ -1,12 +1,30 @@
1
- FROM python:3.11-slim
2
- ENV PYTHONDONTWRITEBYTECODE 1
3
- ENV PYTHONUNBUFFERED 1
4
- ENV STREAMLIT_SERVER_HEADLESS=true
5
- RUN apt-get update && apt-get install -y --no-install-recommends libgl1 && rm -rf /var/lib/apt/lists/*
6
- WORKDIR /app
7
- COPY requirements.txt .
8
- RUN pip install --no-cache-dir -r requirements.txt
9
- COPY . .
10
- EXPOSE 8501
11
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
12
- ENTRYPOINT ["python", "-m", "streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # Environment
4
+ ENV PYTHONDONTWRITEBYTECODE=1
5
+ ENV PYTHONUNBUFFERED=1
6
+ ENV STREAMLIT_SERVER_HEADLESS=true
7
+
8
+ # System dependencies (needed for OpenCV, etc.)
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ libgl1 curl \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Workdir
14
+ WORKDIR /app
15
+
16
+ # Install dependencies
17
+ COPY requirements.txt .
18
+ RUN pip install --no-cache-dir -r requirements.txt
19
+
20
+ # Copy source
21
+ COPY . .
22
+
23
+ # Hugging Face expects port 7860
24
+ EXPOSE 7860
25
+
26
+ # Healthcheck (use the right port!)
27
+ HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health || exit 1
28
+
29
+ # Launch Streamlit on 7860
30
+ ENTRYPOINT ["python", "-m", "streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]