parthlemmecode commited on
Commit
aaa3354
·
verified ·
1 Parent(s): 840cf29

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -6
Dockerfile CHANGED
@@ -1,18 +1,25 @@
1
- # Base image
2
  FROM python:3.10-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Install dependencies
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
- # Copy application
12
  COPY app.py .
13
 
14
- # Expose Gradio port
 
 
 
 
 
 
 
15
  EXPOSE 7860
16
 
17
- # Run app
18
  CMD ["python", "app.py"]
 
1
+ # Dockerfile - Good News App (HF Space)
2
  FROM python:3.10-slim
3
 
4
+ # Create app dir
5
  WORKDIR /app
6
 
7
+ # Copy requirements and install
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
+ # Copy application code
12
  COPY app.py .
13
 
14
+ # Make writable cache directory for Hugging Face / transformers
15
+ RUN mkdir -p /tmp/hf_cache && chmod -R 777 /tmp/hf_cache
16
+
17
+ # Set env vars so transformers/HF use writable cache
18
+ ENV TRANSFORMERS_CACHE=/tmp/hf_cache
19
+ ENV HF_HOME=/tmp/hf_cache
20
+
21
+ # Expose port used by Gradio
22
  EXPOSE 7860
23
 
24
+ # Run the Gradio app
25
  CMD ["python", "app.py"]