Remise en place dans un dossier
This commit is contained in:
+7
-3
@@ -2,11 +2,15 @@ FROM python:3.9-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
# On copie d'abord le fichier des dépendances depuis le dossier 'app'
|
||||
COPY app/requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
# On copie le code source
|
||||
COPY app/ .
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
# IMPORTANT : Le module est maintenant à la racine du WORKDIR (/app)
|
||||
# Uvicorn cherche 'main' à la racine de /app
|
||||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
Reference in New Issue
Block a user