mgbam commited on
Commit
b80050e
Β·
verified Β·
1 Parent(s): a2cba7a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -8
Dockerfile CHANGED
@@ -1,27 +1,32 @@
 
 
 
 
1
  FROM python:3.10-slim
2
 
3
- # ---------------- Core settings ----------------
4
  ENV PYTHONDONTWRITEBYTECODE=1
5
  ENV PYTHONUNBUFFERED=1
6
 
7
- # Make /app the working dirΒ +Β our safe HOME
8
  WORKDIR /app
9
- ENV HOME=/app
10
 
11
- # ---------------- Dependencies -----------------
12
  COPY requirements.txt /app/
13
  RUN pip install --upgrade pip && pip install -r requirements.txt
14
 
15
- # ---------------- App code ---------------------
16
  COPY . /app
17
 
18
- # ---------------- Streamlit / Matplotlib perms --
19
  ENV STREAMLIT_CONFIG_DIR=/app/.streamlit
20
  ENV MPLCONFIGDIR=/app/.config/matplotlib
21
- ENV STREAMLIT_BROWSER_GATHERUSAGESTATS=false # disable metrics write
 
22
 
23
  RUN mkdir -p /app/.streamlit /app/.config/matplotlib
24
 
25
- # ---------------- Expose + run -----------------
26
  EXPOSE 7860
27
  CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
 
1
+ # ─────────────────────────────────────────────────────────────
2
+ # BizIntel AI Ultra – HuggingΒ Face Space (Docker + Streamlit)
3
+ # ─────────────────────────────────────────────────────────────
4
+
5
  FROM python:3.10-slim
6
 
7
+ # ── Basic Python settings ───────────────────────────────────
8
  ENV PYTHONDONTWRITEBYTECODE=1
9
  ENV PYTHONUNBUFFERED=1
10
 
11
+ # ── Create app directory & make it the working dir ──────────
12
  WORKDIR /app
13
+ ENV HOME=/app # ensure Streamlit writes into /app
14
 
15
+ # ── Install Python dependencies ─────────────────────────────
16
  COPY requirements.txt /app/
17
  RUN pip install --upgrade pip && pip install -r requirements.txt
18
 
19
+ # ── Copy the rest of the source code ────────────────────────
20
  COPY . /app
21
 
22
+ # ── Fix Streamlit & Matplotlib permission issues ────────────
23
  ENV STREAMLIT_CONFIG_DIR=/app/.streamlit
24
  ENV MPLCONFIGDIR=/app/.config/matplotlib
25
+ # Disable Streamlit usage‑stats (avoids writes to $HOME/.streamlit)
26
+ ENV STREAMLIT_BROWSER_GATHERUSAGESTATS=false
27
 
28
  RUN mkdir -p /app/.streamlit /app/.config/matplotlib
29
 
30
+ # ── Expose the HF‑required port & launch Streamlit ──────────
31
  EXPOSE 7860
32
  CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]