Files
notytex/backend/Dockerfile
Bertrand Benjamin cff2a33ed0 fix: Docker build issues and uvicorn command
- Add README.md to Dockerfile COPY to satisfy hatchling build requirement
- Fix uvicorn command in backend/README.md (use python -m uvicorn)
- Update uv.lock with correct Python version constraint
2025-11-26 06:13:59 +01:00

30 lines
642 B
Docker

# Dockerfile pour Backend FastAPI
FROM python:3.12-slim
# Variables d'environnement
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
# Installer uv
RUN pip install uv
# Créer répertoire de travail
WORKDIR /app
# Copier les fichiers de dépendances ET le README (requis par hatchling)
COPY pyproject.toml uv.lock README.md ./
# Installer les dépendances
RUN uv sync --frozen
# Copier le code source
COPY . .
# Exposer le port
EXPOSE 8000
# Commande de démarrage
CMD ["uv", "run", "python", "-m", "uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]