# Utiliser l'image officielle Python
FROM python:3.9-slim

# Installer les dépendances du système
RUN apt-get update && apt-get install -y libpq-dev python3-flask python3-flask-sqlalchemy python3-flask-login python3-flask-security python3-psycopg2 python3-gunicorn

# Définir le répertoire de travail
WORKDIR /app

# Copier les fichiers nécessaires
COPY requirements.txt /app/requirements.txt
COPY . /app

# Installer les dépendances Python
RUN pip install --no-cache-dir -r requirements.txt

# Exposer le port de l'application Flask
EXPOSE 5000

# Lancer l'application
#CMD ["bash", "setup_SAE23.sh", "--create-db"]
#CMD ["python3", "setup_database.py"]
CMD ["gunicorn", "-b", "0.0.0.0:5000", "app:app"]
