drrobot9 commited on
Commit
56b734d
·
verified ·
1 Parent(s): 63730eb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +41 -3
Dockerfile CHANGED
@@ -1,8 +1,46 @@
1
- FROM python:3.10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- WORKDIR /app
4
  COPY . .
5
 
6
- RUN pip install --no-cache-dir -r requirements.txt
7
 
8
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.12-slim-bookworm
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive \
4
+ PYTHONUNBUFFERED=1 \
5
+ PYTHONDONTWRITEBYTECODE=1 \
6
+ PIP_NO_CACHE_DIR=1 \
7
+ HF_HOME=/opt/models \
8
+ TRANSFORMERS_CACHE=/opt/models \
9
+ HUGGINGFACE_HUB_CACHE=/opt/models
10
+
11
+ WORKDIR /code
12
+
13
+ RUN apt-get update && apt-get install -y --no-install-recommends \
14
+ git \
15
+ wget \
16
+ curl \
17
+ ffmpeg \
18
+ libsndfile1 \
19
+ gcc \
20
+ g++ \
21
+ build-essential \
22
+ python3-dev \
23
+ pkg-config \
24
+ libsentencepiece-dev \
25
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
26
+
27
+ COPY requirements.txt .
28
+ RUN pip install --upgrade pip \
29
+ && pip install --no-cache-dir -r requirements.txt
30
+
31
+
32
+ RUN python - <<PYEOF
33
+ from huggingface_hub import snapshot_download
34
+ snapshot_download(
35
+ repo_id="nvidia/personaplex-7b-v1",
36
+ local_dir="/opt/models/personaplex",
37
+ local_dir_use_symlinks=False
38
+ )
39
+ print("Model downloaded successfully.")
40
+ PYEOF
41
 
 
42
  COPY . .
43
 
44
+ EXPOSE 7860
45
 
46
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]