Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -1
Dockerfile
CHANGED
|
@@ -9,13 +9,17 @@ RUN apt-get update && apt-get install -y \
|
|
| 9 |
apt-transport-https \
|
| 10 |
gnupg \
|
| 11 |
libodbc1 \
|
| 12 |
-
odbcinst
|
|
|
|
| 13 |
|
| 14 |
# Add Microsoft repository and install ODBC Driver 18
|
| 15 |
RUN curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | tee /etc/apt/trusted.gpg.d/microsoft.asc
|
| 16 |
RUN echo "deb [arch=amd64] https://packages.microsoft.com/debian/11/prod bookworm main" > /etc/apt/sources.list.d/mssql-release.list
|
| 17 |
RUN apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql18
|
| 18 |
|
|
|
|
|
|
|
|
|
|
| 19 |
# Verify ODBC installation
|
| 20 |
RUN ls -l /usr/lib/x86_64-linux-gnu/ | grep odbc
|
| 21 |
RUN odbcinst -q -d
|
|
@@ -27,6 +31,9 @@ WORKDIR /home/user/app
|
|
| 27 |
COPY requirements.txt .
|
| 28 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 29 |
|
|
|
|
|
|
|
|
|
|
| 30 |
# Copy application code
|
| 31 |
COPY . .
|
| 32 |
|
|
|
|
| 9 |
apt-transport-https \
|
| 10 |
gnupg \
|
| 11 |
libodbc1 \
|
| 12 |
+
odbcinst \
|
| 13 |
+
libodbc2
|
| 14 |
|
| 15 |
# Add Microsoft repository and install ODBC Driver 18
|
| 16 |
RUN curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | tee /etc/apt/trusted.gpg.d/microsoft.asc
|
| 17 |
RUN echo "deb [arch=amd64] https://packages.microsoft.com/debian/11/prod bookworm main" > /etc/apt/sources.list.d/mssql-release.list
|
| 18 |
RUN apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql18
|
| 19 |
|
| 20 |
+
# Manually create a symbolic link to fix libodbc.so.2 missing error
|
| 21 |
+
RUN ln -s /usr/lib/x86_64-linux-gnu/libodbc.so /usr/lib/x86_64-linux-gnu/libodbc.so.2
|
| 22 |
+
|
| 23 |
# Verify ODBC installation
|
| 24 |
RUN ls -l /usr/lib/x86_64-linux-gnu/ | grep odbc
|
| 25 |
RUN odbcinst -q -d
|
|
|
|
| 31 |
COPY requirements.txt .
|
| 32 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 33 |
|
| 34 |
+
# Force reinstall pyodbc inside the container
|
| 35 |
+
RUN pip uninstall -y pyodbc && pip install --no-cache-dir pyodbc
|
| 36 |
+
|
| 37 |
# Copy application code
|
| 38 |
COPY . .
|
| 39 |
|