WaysAheadGlobal commited on
Commit
a10ad06
·
verified ·
1 Parent(s): 59e80a0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -10
Dockerfile CHANGED
@@ -1,28 +1,31 @@
1
  FROM python:3.10-slim
2
 
 
3
  RUN apt-get update && \
4
  apt-get install -y git && \
5
  rm -rf /var/lib/apt/lists/*
6
 
7
  WORKDIR /app
8
 
 
9
  COPY requirements.txt .
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
12
- # Clone correct TinyLLaVA source
13
- RUN git clone --depth 1 https://github.com/DLCV-BUAA/TinyLLaVABench.git /tmp/tlv && \
14
- cp -r /tmp/tlv/tinyllava ./tinyllava && \
15
- rm -rf /tmp/tlv
16
-
17
- # Check existence (optional debug)
18
- RUN test -d ./tinyllava
19
  RUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache
 
 
 
 
 
 
20
  COPY app.py .
21
 
22
  EXPOSE 8501
23
 
24
- ENV STREAMLIT_SERVER_HEADLESS=true \
25
- STREAMLIT_SERVER_PORT=8501 \
26
- STREAMLIT_SERVER_ADDRESS=0.0.0.0
 
27
 
28
  CMD ["streamlit", "run", "app.py"]
 
1
  FROM python:3.10-slim
2
 
3
+ # Install git (Hugging Face sometimes uses it for custom code)
4
  RUN apt-get update && \
5
  apt-get install -y git && \
6
  rm -rf /var/lib/apt/lists/*
7
 
8
  WORKDIR /app
9
 
10
+ # Install Python dependencies
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
+ # Create a safe writable cache folder
 
 
 
 
 
 
15
  RUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache
16
+
17
+ # ✅ Point HF + Transformers cache to that folder
18
+ ENV HF_HOME=/app/hf_cache
19
+ ENV TRANSFORMERS_CACHE=/app/hf_cache
20
+
21
+ # Copy your Streamlit app
22
  COPY app.py .
23
 
24
  EXPOSE 8501
25
 
26
+ # Streamlit config
27
+ ENV STREAMLIT_SERVER_HEADLESS=true
28
+ ENV STREAMLIT_SERVER_PORT=8501
29
+ ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
30
 
31
  CMD ["streamlit", "run", "app.py"]