tsrivallabh commited on
Commit
ec346f3
·
verified ·
1 Parent(s): f9a2db5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -22
Dockerfile CHANGED
@@ -1,34 +1,19 @@
1
  # Use an official Python runtime as a parent image
2
  FROM python:3.11-slim
3
 
4
- # Set the working directory in the container
5
  WORKDIR /app
6
 
7
- # Set environment variables for HF cache
8
- ENV HF_HOME=/data/hf_cache
9
- ENV TRANSFORMERS_CACHE=/data/hf_cache/transformers
10
- ENV HF_DATASETS_CACHE=/data/hf_cache/datasets
11
- ENV HF_HUB_CACHE=/data/hf_cache/hub
12
-
13
- # Create cache directories and give permissions
14
- RUN mkdir -p /data/hf_cache/transformers /data/hf_cache/datasets /data/hf_cache/hub \
15
- && chmod -R 777 /data/hf_cache
16
 
17
- # Create .streamlit directory for Streamlit configs
18
- RUN mkdir -p /app/.streamlit
19
 
20
- # Copy requirements and install dependencies
21
- COPY requirements.txt .
22
  RUN pip install --no-cache-dir -r requirements.txt
23
 
24
- # Copy the rest of your app code
25
- COPY . .
26
-
27
- # If you have a .streamlit/config.toml, copy it explicitly
28
- # This prevents the PermissionError when Streamlit tries to write defaults
29
- COPY .streamlit/config.toml /app/.streamlit/
30
-
31
- # Expose the port Streamlit runs on
32
  EXPOSE 8501
33
 
34
  # Run Streamlit
 
1
  # Use an official Python runtime as a parent image
2
  FROM python:3.11-slim
3
 
4
+ # Set working directory
5
  WORKDIR /app
6
 
7
+ # Copy everything first (including .streamlit)
8
+ COPY . .
 
 
 
 
 
 
 
9
 
10
+ # Fix permissions (make sure /app is writable)
11
+ RUN chmod -R 777 /app
12
 
13
+ # Install dependencies
 
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
+ # Expose port
 
 
 
 
 
 
 
17
  EXPOSE 8501
18
 
19
  # Run Streamlit