WillyCodesInit commited on
Commit
a9b9639
·
verified ·
1 Parent(s): 2b1f45e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -6
Dockerfile CHANGED
@@ -1,22 +1,21 @@
1
- # Use the official lightweight Python image
2
  FROM python:3.10-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Copy source files
8
  COPY ./src /app/src
9
  COPY requirements.txt .
10
 
11
- # Create a writable cache directory for transformers
12
  RUN mkdir -p /app/cache
13
 
14
  # Install dependencies
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
- # Set environment variables
 
18
  ENV TRANSFORMERS_CACHE=/app/cache
19
  ENV STREAMLIT_SERVER_HEADLESS=true
20
 
21
- # Run the app using Streamlit
22
  CMD ["streamlit", "run", "src/streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]
 
 
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /app
4
 
5
+ # Copy files
6
  COPY ./src /app/src
7
  COPY requirements.txt .
8
 
9
+ # Create a safe cache directory
10
  RUN mkdir -p /app/cache
11
 
12
  # Install dependencies
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
+ # Set environment variables for safe caching
16
+ ENV HF_HOME=/app/cache
17
  ENV TRANSFORMERS_CACHE=/app/cache
18
  ENV STREAMLIT_SERVER_HEADLESS=true
19
 
20
+ # Run the app
21
  CMD ["streamlit", "run", "src/streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]