21 lines
No EOL
549 B
Docker
21 lines
No EOL
549 B
Docker
# Backend Dockerfile
|
|
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Copier et installer les dépendances
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir --upgrade pip \
|
|
&& pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copier le reste du projet
|
|
COPY . .
|
|
|
|
# ✅ Créer dossier persistant pour SQLite avec bonnes permissions
|
|
RUN mkdir -p /app/data && chmod 777 /app/data
|
|
|
|
# Exposer le port
|
|
EXPOSE 8000
|
|
|
|
# Lancer l'API et initialiser la DB au démarrage
|
|
CMD ["sh", "-c", "python init_db.py && uvicorn api:app --host 0.0.0.0 --port 8000 --reload"] |