# Utiliser une image Windows Server Core pour supporter COM et COFE/COCO
FROM mcr.microsoft.com/windows/servercore:ltsc2022

# Installer Python
RUN powershell -Command `
    Invoke-WebRequest -Uri 'https://www.python.org/ftp/python/3.11.0/python-3.11.0-amd64.exe' -OutFile 'python-installer.exe'; `
    Start-Process python-installer.exe -ArgumentList '/quiet InstallAllUsers=1 PrependPath=1' -Wait; `
    Remove-Item python-installer.exe

# Créer le répertoire de travail
WORKDIR /app

# Copier les fichiers de l'application dans le conteneur
COPY requirements.txt .
COPY app.py .
COPY cofe_simulation.py .
COPY "SDGS12_ZOE FQ_ID with recycle_ECC_JT_R07_GZ-UDU_25_05-13 validated - no condenser.fsd" .

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

# Exposer le port utilisé par Flask
EXPOSE 8080

# Commande de démarrage du serveur Flask
CMD ["python", "app.py"]
