QuentinL52 commited on
Commit
154287e
·
verified ·
1 Parent(s): 326edb6

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ ENV XDG_DATA_HOME="/tmp/.local/share" \
6
+ HF_HOME="/tmp/cache" \
7
+ TRANSFORMERS_CACHE="/tmp/cache" \
8
+ HF_HUB_CACHE="/tmp/cache/hub" \
9
+ SENTENCE_TRANSFORMERS_HOME="/tmp/cache/sentence_transformers"
10
+
11
+ RUN apt-get update && apt-get install -y \
12
+ curl \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ COPY requirements.txt .
16
+ RUN pip install --no-cache-dir -r requirements.txt
17
+
18
+ COPY . .
19
+
20
+ RUN mkdir -p /tmp/.local/share \
21
+ /tmp/cache/hub \
22
+ /tmp/cache/sentence_transformers \
23
+ /tmp/vector_store \
24
+ /app/.local/share \
25
+ /app/vector_store && \
26
+ chmod -R 777 /tmp /app
27
+
28
+ # Expose le port 7860.
29
+ EXPOSE 7860
30
+
31
+ # Commande pour démarrer l'application FastAPI en utilisant le port 7860.
32
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]