GDMProjects commited on
Commit
59a0ad9
·
verified ·
1 Parent(s): f664075

Create Dockefile

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