Darayut commited on
Commit
fea4b44
·
verified ·
1 Parent(s): 833733d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -2
Dockerfile CHANGED
@@ -1,7 +1,8 @@
1
- FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  curl \
@@ -9,10 +10,21 @@ RUN apt-get update && apt-get install -y \
9
  git \
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
 
 
 
 
 
 
12
  COPY requirements.txt ./
 
 
 
13
  COPY src/ ./src/
14
 
15
- RUN pip3 install -r requirements.txt
 
16
 
17
  EXPOSE 8501
18
 
 
1
+ FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
8
  curl \
 
10
  git \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # Set environment variables for cache directories
14
+ ENV STREAMLIT_HOME=/app/.streamlit
15
+ ENV HF_HOME=/app/.cache/huggingface
16
+ ENV TRANSFORMERS_CACHE=/app/.cache/transformers
17
+ ENV TORCH_HOME=/app/.cache/torch
18
+
19
+ # Copy requirements and install Python dependencies
20
  COPY requirements.txt ./
21
+ RUN pip3 install -r requirements.txt
22
+
23
+ # Copy source code
24
  COPY src/ ./src/
25
 
26
+ # Create necessary directories with proper permissions
27
+ RUN mkdir -p /app/.streamlit /app/.cache/huggingface /app/.cache/transformers /app/.cache/torch /app/data /app/chroma
28
 
29
  EXPOSE 8501
30