Aidahaouas commited on
Commit
e585ffd
·
verified ·
1 Parent(s): 09a925a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -17
Dockerfile CHANGED
@@ -1,29 +1,29 @@
1
- # Utilisation d'une image Debian compatible avec Hugging Face
2
- FROM python:3.9
3
 
4
- # Mise à jour des paquets et installation de ODBC + dépendances
5
- RUN apt-get update && apt-get install -y \
6
- curl \
7
- gnupg2 \
8
  unixodbc \
9
  unixodbc-dev \
10
- odbcinst \
11
- libpq-dev \
12
- && rm -rf /var/lib/apt/lists/*
13
 
14
- # Installation du driver ODBC pour Microsoft SQL Server
15
  RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
16
- curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
17
  apt-get update && \
18
- ACCEPT_EULA=Y apt-get install -y msodbcsql17
 
 
19
 
20
- # Création d'un environnement virtuel
21
- WORKDIR /app
22
  COPY requirements.txt .
23
  RUN pip install --no-cache-dir -r requirements.txt
24
 
25
- # Copie du projet
26
  COPY . .
27
 
28
- # Commande pour lancer Streamlit
29
- CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.enableCORS=false"]
 
1
+ # Utiliser une image de base avec Python
2
+ FROM python:3.9-slim
3
 
4
+ # Installer les dépendances système
5
+ RUN apt-get update && \
6
+ apt-get install -y --no-install-recommends \
 
7
  unixodbc \
8
  unixodbc-dev \
9
+ curl && \
10
+ apt-get clean && \
11
+ rm -rf /var/lib/apt/lists/*
12
 
13
+ # Installer le pilote ODBC pour SQL Server
14
  RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
15
+ curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
16
  apt-get update && \
17
+ ACCEPT_EULA=Y apt-get install -y msodbcsql17 && \
18
+ apt-get clean && \
19
+ rm -rf /var/lib/apt/lists/*
20
 
21
+ # Copier le fichier requirements.txt et installer les dépendances Python
 
22
  COPY requirements.txt .
23
  RUN pip install --no-cache-dir -r requirements.txt
24
 
25
+ # Copier le reste de l'application
26
  COPY . .
27
 
28
+ # Commande pour lancer l'application
29
+ CMD ["python", "app.py"]