Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +17 -17
Dockerfile
CHANGED
|
@@ -1,29 +1,29 @@
|
|
| 1 |
-
#
|
| 2 |
-
FROM python:3.9
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
RUN apt-get update &&
|
| 6 |
-
|
| 7 |
-
gnupg2 \
|
| 8 |
unixodbc \
|
| 9 |
unixodbc-dev \
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
|
| 14 |
-
#
|
| 15 |
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
|
| 16 |
-
curl https://packages.microsoft.com/config/debian/
|
| 17 |
apt-get update && \
|
| 18 |
-
ACCEPT_EULA=Y apt-get install -y msodbcsql17
|
|
|
|
|
|
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
WORKDIR /app
|
| 22 |
COPY requirements.txt .
|
| 23 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 24 |
|
| 25 |
-
#
|
| 26 |
COPY . .
|
| 27 |
|
| 28 |
-
# Commande pour lancer
|
| 29 |
-
CMD ["
|
|
|
|
| 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"]
|