fix(docker): Fix docker file

The docker file was updated to align with the software
requirements of the app. An additional script `install_odbc.sh` is added
to install the required microsoft ODBC driver.
This commit is contained in:
Tobias Quadfasel
2024-09-03 17:23:41 +02:00
parent d9e570c75a
commit e9adb3c588
3 changed files with 35 additions and 0 deletions

View File

@@ -1,5 +1,13 @@
#!/bin/sh
# Install ODBC driver
./install_odbc.sh
# Start Dash and run in background
echo "Starting Dash app..."
if [ -f "/app/env.sh" ]; then
. "/app/env.sh"
echo "env.sh has been sourced."
fi
poetry run gunicorn app:server -b 0.0.0.0:8000

24
.docker/install_odbc.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/sh
apt-get update
apt-get install -y curl gnupg2 apt-transport-https
# Debian 12
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg
#Download appropriate package for the OS version
#Choose only ONE of the following, corresponding to your OS version
#Debian 12
curl https://packages.microsoft.com/config/debian/12/prod.list | tee /etc/apt/sources.list.d/mssql-release.list
apt-get update
ACCEPT_EULA=Y apt-get install -y msodbcsql18
# optional: for bcp and sqlcmd
ACCEPT_EULA=Y apt-get install -y mssql-tools18
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
. ~/.bashrc
# optional: for unixODBC development headers
apt-get install -y unixodbc-dev
# optional: kerberos library for debian-slim distributions
apt-get install -y libgssapi-krb5-2

View File

@@ -34,7 +34,10 @@ COPY app/ app/
RUN poetry install --no-interaction --no-dev
COPY ./.docker/entrypoint.sh /app/entrypoint.sh
COPY ./.docker/install_odbc.sh /app/install_odbc.sh
RUN chmod +x /app/entrypoint.sh
RUN chmod +x /app/install_odbc.sh
WORKDIR /app