mgbam commited on
Commit
83a3f71
Β·
verified Β·
1 Parent(s): 598f524

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -27
Dockerfile CHANGED
@@ -1,42 +1,44 @@
1
- # Dockerfile
 
 
2
  FROM python:3.10-slim
3
 
4
- # Environment variables for Streamlit telemetry and buffering
5
  ENV PYTHONUNBUFFERED=1 \
6
  STREAMLIT_DATA_DIR=/tmp/.streamlit \
7
  XDG_STATE_HOME=/tmp \
8
  STREAMLIT_BROWSER_GATHERUSAGESTATS=false
9
 
10
- # Install OS dependencies
11
  RUN apt-get update && \
12
  apt-get install -y --no-install-recommends \
13
- build-essential \
14
- curl && \
15
  rm -rf /var/lib/apt/lists/*
16
 
17
- # Pin numpy to avoid C-extension mismatches
18
  RUN pip install --no-cache-dir numpy==1.23.5
19
 
20
  # Install Python dependencies
21
  RUN pip install --no-cache-dir \
22
- spacy==3.5.2 \
23
- transformers \
24
- huggingface-hub \
25
- scikit-learn \
26
- httpx \
27
- pandas \
28
- plotly \
29
- fpdf \
30
- streamlit \
31
- streamlit-agraph \
32
- networkx \
33
- xmltodict \
34
- feedparser \
35
- pydantic \
36
- openai \
37
- google-generativeai
38
-
39
- # Download spaCy model
40
  RUN python -m spacy download en_core_web_sm
41
 
42
  # Set working directory
@@ -45,8 +47,12 @@ WORKDIR /app
45
  # Copy application code
46
  COPY . /app
47
 
48
- # Expose Streamlit port
49
  EXPOSE 8501
50
 
51
- # Launch Streamlit app
52
- ENTRYPOINT ["streamlit", "run", "app.py", "--server.address=0.0.0.0", "--server.port=8501"]
 
 
 
 
 
1
+ # ── Dockerfile for MedGenesis AI ────────────────────────────────────────
2
+
3
+ # Use a lightweight Python base image
4
  FROM python:3.10-slim
5
 
6
+ # Ensure stdout/stderr are not buffered, and configure Streamlit telemetry
7
  ENV PYTHONUNBUFFERED=1 \
8
  STREAMLIT_DATA_DIR=/tmp/.streamlit \
9
  XDG_STATE_HOME=/tmp \
10
  STREAMLIT_BROWSER_GATHERUSAGESTATS=false
11
 
12
+ # Install system dependencies
13
  RUN apt-get update && \
14
  apt-get install -y --no-install-recommends \
15
+ build-essential \
16
+ curl && \
17
  rm -rf /var/lib/apt/lists/*
18
 
19
+ # Pin numpy to avoid C-extension mismatches with spaCy
20
  RUN pip install --no-cache-dir numpy==1.23.5
21
 
22
  # Install Python dependencies
23
  RUN pip install --no-cache-dir \
24
+ spacy==3.5.2 \
25
+ transformers \
26
+ huggingface-hub \
27
+ scikit-learn \
28
+ httpx \
29
+ pandas \
30
+ plotly \
31
+ fpdf \
32
+ streamlit \
33
+ streamlit-agraph \
34
+ networkx \
35
+ xmltodict \
36
+ feedparser \
37
+ pydantic \
38
+ openai \
39
+ google-generativeai
40
+
41
+ # Pre-download spaCy English model
42
  RUN python -m spacy download en_core_web_sm
43
 
44
  # Set working directory
 
47
  # Copy application code
48
  COPY . /app
49
 
50
+ # Expose Streamlit default port
51
  EXPOSE 8501
52
 
53
+ # Launch the Streamlit app in headless mode with debug logging
54
+ CMD ["streamlit", "run", "app.py", \
55
+ "--server.address=0.0.0.0", \
56
+ "--server.port=8501", \
57
+ "--server.headless", "true", \
58
+ "--logger.level", "info"]