GDMProjects commited on
Commit
f2b4837
·
verified ·
1 Parent(s): e7a74e0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -2
Dockerfile CHANGED
@@ -1,15 +1,34 @@
 
1
  FROM python:3.10-slim
 
 
 
 
 
 
 
2
  WORKDIR /app
3
 
4
- # Copy your app and data into the image
5
- COPY app.py .
6
  COPY requirements.txt .
7
  COPY subset_best_model.pkl .
8
  COPY GTT.csv .
9
 
 
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
 
 
 
 
 
 
 
 
12
  EXPOSE 7860
13
  ENV GRADIO_SERVER_NAME=0.0.0.0
14
  ENV MPLCONFIGDIR=/tmp/matplotlib
 
 
15
  CMD ["python", "app.py"]
 
1
+ # Base
2
  FROM python:3.10-slim
3
+
4
+ # System deps for LightGBM (OpenMP)
5
+ RUN apt-get update \
6
+ && apt-get install -y --no-install-recommends libgomp1 \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ # App workdir
10
  WORKDIR /app
11
 
12
+ # Copy files first (owned by root initially)
13
+ COPY app.py .
14
  COPY requirements.txt .
15
  COPY subset_best_model.pkl .
16
  COPY GTT.csv .
17
 
18
+ # Install Python deps
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
+ # Make /app writable for the runtime user to avoid PyCaret logging warnings
22
+ # (Hugging Face Spaces often runs as a non-root user)
23
+ RUN chmod -R a+rw /app
24
+
25
+ # Optional: pre-create a writable log file to silence the warning completely
26
+ RUN touch /app/logs.log && chmod 666 /app/logs.log
27
+
28
+ # Gradio / Matplotlib envs
29
  EXPOSE 7860
30
  ENV GRADIO_SERVER_NAME=0.0.0.0
31
  ENV MPLCONFIGDIR=/tmp/matplotlib
32
+ ENV PYTHONUNBUFFERED=1
33
+
34
  CMD ["python", "app.py"]