nexusbert commited on
Commit
9039780
·
1 Parent(s): fb0861a

push agenda docker

Browse files
Files changed (2) hide show
  1. Dockerfile +24 -5
  2. run.sh +0 -5
Dockerfile CHANGED
@@ -1,8 +1,20 @@
1
- FROM python:3.11-slim
2
 
3
- WORKDIR /app
4
 
5
- RUN apt-get update && apt-get install -y \
 
 
 
 
 
 
 
 
 
 
 
 
6
  libgl1 \
7
  libglib2.0-0 \
8
  && rm -rf /var/lib/apt/lists/*
@@ -10,9 +22,16 @@ RUN apt-get update && apt-get install -y \
10
  COPY requirements.txt .
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
 
 
 
 
 
 
 
 
13
  COPY . .
14
 
15
  EXPOSE 7860
16
 
17
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
18
-
 
1
+ FROM python:3.10-slim
2
 
3
+ ARG HF_TOKEN
4
 
5
+ ENV DEBIAN_FRONTEND=noninteractive \
6
+ PYTHONUNBUFFERED=1 \
7
+ PYTHONDONTWRITEBYTECODE=1 \
8
+ HF_TOKEN=${HF_TOKEN}
9
+
10
+ WORKDIR /code
11
+
12
+ RUN apt-get update && apt-get install -y --no-install-recommends \
13
+ build-essential \
14
+ git \
15
+ curl \
16
+ libopenblas-dev \
17
+ libomp-dev \
18
  libgl1 \
19
  libglib2.0-0 \
20
  && rm -rf /var/lib/apt/lists/*
 
22
  COPY requirements.txt .
23
  RUN pip install --no-cache-dir -r requirements.txt
24
 
25
+ RUN pip install --no-cache-dir huggingface-hub sentencepiece accelerate
26
+
27
+ ENV HF_HOME=/models/huggingface \
28
+ HUGGINGFACE_HUB_CACHE=/models/huggingface \
29
+ HF_HUB_CACHE=/models/huggingface
30
+
31
+ RUN mkdir -p /models/huggingface && chmod -R 777 /models/huggingface
32
+
33
  COPY . .
34
 
35
  EXPOSE 7860
36
 
37
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
 
run.sh DELETED
@@ -1,5 +0,0 @@
1
- #!/bin/bash
2
- # Simple script to run the FastAPI app locally
3
-
4
- uvicorn app:app --host 0.0.0.0 --port 7860 --reload
5
-