mbwanaf commited on
Commit
3fa1adc
·
verified ·
1 Parent(s): 72a7a56

update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -4
Dockerfile CHANGED
@@ -2,20 +2,25 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  curl \
8
- software-properties-common \
9
  git \
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
 
 
 
 
 
 
12
  COPY requirements.txt ./
13
- RUN pip3 install --no-cache-dir -r requirements.txt
14
 
15
  COPY . .
16
 
17
  EXPOSE 8501
18
 
19
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
20
-
21
  CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install required system packages
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
8
  curl \
 
9
  git \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Set environment variables EARLY
13
+ ENV STREAMLIT_HOME=/tmp
14
+ ENV STREAMLIT_RUNTIME_METRICS_ENABLED=false
15
+ ENV STREAMLIT_WATCHED_MODULES=""
16
+ ENV TRANSFORMERS_CACHE=/tmp/hf_cache
17
+ ENV HF_HOME=/tmp/huggingface
18
+
19
  COPY requirements.txt ./
20
+ RUN pip install -r requirements.txt
21
 
22
  COPY . .
23
 
24
  EXPOSE 8501
25
 
 
 
26
  CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]