Entz commited on
Commit
b6387e7
·
verified ·
1 Parent(s): 2673311

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -10
Dockerfile CHANGED
@@ -5,24 +5,26 @@ ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
5
  PYTHONDONTWRITEBYTECODE=1 \
6
  PYTHONUNBUFFERED=1
7
 
8
- # System deps
9
- RUN apt-get update && apt-get install -y --no-install-recommends \
10
- build-essential git curl && \
11
- rm -rf /var/lib/apt/lists/*
12
 
13
  WORKDIR /app
14
 
15
- # Install deps first for better caching
16
  COPY requirements.txt /app/
17
- RUN pip install --upgrade pip && pip install -r requirements.txt
18
 
19
- # Copy source
20
  COPY . /app
21
 
22
- # Hugging Face Spaces typically expose $PORT; default to 7860 for local runs
23
  ENV PORT=7860
24
  EXPOSE 7860
 
 
25
  HEALTHCHECK --interval=10s --timeout=3s --start-period=20s --retries=3 \
26
- CMD curl -fsS "http://127.0.0.1:${PORT}/" || exit 1
27
- CMD bash -lc "streamlit run frontend.py --server.address=0.0.0.0 --server.port=$PORT"
28
 
 
 
 
5
  PYTHONDONTWRITEBYTECODE=1 \
6
  PYTHONUNBUFFERED=1
7
 
8
+ # (Needed for the HEALTHCHECK)
9
+ RUN apt-get update && apt-get install -y --no-install-recommends curl \
10
+ && rm -rf /var/lib/apt/lists/*
 
11
 
12
  WORKDIR /app
13
 
14
+ # Install deps first for build caching
15
  COPY requirements.txt /app/
16
+ RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
17
 
18
+ # Copy ALL app files (frontend, backend, both MCP servers, etc.)
19
  COPY . /app
20
 
21
+ # HF Spaces provides a dynamic $PORT; use it (8501 is brittle in Docker Spaces)
22
  ENV PORT=7860
23
  EXPOSE 7860
24
+
25
+ # Make readiness explicit so Space flips from "Starting" → "Running"
26
  HEALTHCHECK --interval=10s --timeout=3s --start-period=20s --retries=3 \
27
+ CMD curl -fsS "http://127.0.0.1:${PORT}/_stcore/health" || exit 1
 
28
 
29
+ # Launch Streamlit on the Space port
30
+ CMD bash -lc "streamlit run frontend.py --server.address=0.0.0.0 --server.port=$PORT"