varsshancoder commited on
Commit
10c32cf
·
verified ·
1 Parent(s): b33501b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -6
Dockerfile CHANGED
@@ -3,11 +3,12 @@ FROM python:3.10-slim
3
  ENV PYTHONUNBUFFERED=1 \
4
  HOME=/home/user \
5
  PATH=/home/user/.local/bin:$PATH \
6
- HF_HOME=/home/user/.cache/huggingface
 
7
 
8
- WORKDIR $HOME
9
 
10
- # Install essential compilation dependencies required to build llama-cpp
11
  RUN apt-get update && apt-get install -y \
12
  build-essential \
13
  cmake \
@@ -16,13 +17,17 @@ RUN apt-get update && apt-get install -y \
16
  git \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
- RUN mkdir -p /home/user/.cache && chmod -R 777 /home/user
 
 
20
 
21
  COPY requirements.txt .
22
- RUN pip install --no-cache-dir --upgrade pip && \
23
- pip install --no-cache-dir -r requirements.txt
 
24
 
25
  COPY --chown=1000 . .
26
 
27
  EXPOSE 7860
 
28
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
3
  ENV PYTHONUNBUFFERED=1 \
4
  HOME=/home/user \
5
  PATH=/home/user/.local/bin:$PATH \
6
+ HF_HOME=/home/user/.cache/huggingface \
7
+ PIP_NO_CACHE_DIR=1
8
 
9
+ WORKDIR /home/user
10
 
11
+ # Build dependencies required by llama-cpp-python
12
  RUN apt-get update && apt-get install -y \
13
  build-essential \
14
  cmake \
 
17
  git \
18
  && rm -rf /var/lib/apt/lists/*
19
 
20
+ # Create writable Hugging Face cache
21
+ RUN mkdir -p /home/user/.cache/huggingface \
22
+ && chmod -R 777 /home/user
23
 
24
  COPY requirements.txt .
25
+
26
+ RUN pip install --upgrade pip \
27
+ && pip install -r requirements.txt
28
 
29
  COPY --chown=1000 . .
30
 
31
  EXPOSE 7860
32
+
33
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]