prd101-wd commited on
Commit
b561a12
·
verified ·
1 Parent(s): 6a947f8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -15
Dockerfile CHANGED
@@ -1,28 +1,31 @@
1
- FROM python:3.9-slim
 
2
 
3
  # Set environment variables to avoid caching issues with Hugging Face
4
- ENV HF_HOME=/tmp/huggingface \
5
- TRANSFORMERS_CACHE=/tmp/huggingface/transformers \
6
- HF_DATASETS_CACHE=/tmp/huggingface/datasets \
7
- HUGGINGFACE_HUB_CACHE=/tmp/huggingface/hub \
8
- XDG_CACHE_HOME=/tmp/huggingface
9
 
10
  WORKDIR /app
11
 
12
- RUN apt-get update && apt-get install -y \
13
- build-essential \
14
- curl \
15
- software-properties-common \
16
- git \
17
- && rm -rf /var/lib/apt/lists/*
 
 
18
 
19
  COPY requirements.txt ./
20
  COPY src/ ./src/
21
 
22
- RUN pip3 install -r requirements.txt
23
-
24
  EXPOSE 7860
25
 
 
 
26
  # HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
27
 
28
- CMD ["streamlit", "run", "src/model_consumer.py", "--server.port=7860", "--server.address=0.0.0.0"]
 
1
+ #FROM python:3.9-slim
2
+ FROM python:3.10-slim
3
 
4
  # Set environment variables to avoid caching issues with Hugging Face
5
+ # ENV HF_HOME=/tmp/huggingface \
6
+ # TRANSFORMERS_CACHE=/tmp/huggingface/transformers \
7
+ # HF_DATASETS_CACHE=/tmp/huggingface/datasets \
8
+ # HUGGINGFACE_HUB_CACHE=/tmp/huggingface/hub \
9
+ # XDG_CACHE_HOME=/tmp/huggingface
10
 
11
  WORKDIR /app
12
 
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
+
15
+ # RUN apt-get update && apt-get install -y \
16
+ # build-essential \
17
+ # curl \
18
+ # software-properties-common \
19
+ # git \
20
+ # && rm -rf /var/lib/apt/lists/*
21
 
22
  COPY requirements.txt ./
23
  COPY src/ ./src/
24
 
 
 
25
  EXPOSE 7860
26
 
27
+ ENV PYTHONUNBUFFERED=1
28
+
29
  # HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
30
 
31
+ CMD ["streamlit", "run", "./src/model_consumer.py", "--server.port=7860", "--server.address=0.0.0.0"]