16 lines
421 B
Docker
16 lines
421 B
Docker
FROM python:3.9-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# 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
|
|
|
|
# On copie le code source
|
|
COPY app/ .
|
|
|
|
EXPOSE 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"] |