QuentinL52 commited on
Commit
ab7007e
·
verified ·
1 Parent(s): 73e1ca2

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -10
Dockerfile CHANGED
@@ -1,18 +1,29 @@
1
- FROM python:3.10-slim
 
 
 
 
 
 
 
 
 
2
 
3
  WORKDIR /app
4
 
5
- # Copie requirements.txt d'abord pour optimiser le cache Docker
6
- COPY ./requirements.txt .
 
7
 
8
- # Installe les dépendances
9
- RUN pip install --no-cache-dir -r requirements.txt
10
 
11
- # Copie le reste des fichiers du projet
12
  COPY . .
13
 
14
- # Expose le port sur lequel l'application s'exécute
15
- EXPOSE 8001
 
 
 
16
 
17
- # Commande pour démarrer l'application FastAPI
18
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8001"]
 
1
+ FROM python:3.11-slim
2
+
3
+ ENV PYTHONUNBUFFERED=1 \
4
+ PYTHONDONTWRITEBYTECODE=1 \
5
+ PIP_NO_CACHE_DIR=1 \
6
+ PIP_DISABLE_PIP_VERSION_CHECK=1 \
7
+ PYTHONPATH=/app
8
+
9
+
10
+ ENV XDG_DATA_HOME="/app/.local/share"
11
 
12
  WORKDIR /app
13
 
14
+ RUN apt-get update && apt-get install -y \
15
+ curl \
16
+ && rm -rf /var/lib/apt/lists/*
17
 
18
+ COPY requirements.txt .
19
+ RUN pip install --system --no-cache -r requirements.txt
20
 
 
21
  COPY . .
22
 
23
+ RUN mkdir -p /tmp/cache/hub \
24
+ /app/.local/share && \
25
+ chmod -R 777 /tmp /app/.local
26
+
27
+ EXPOSE 7860
28
 
29
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]