Giter Site home page Giter Site logo

App not updating about pyodbc HOT 4 CLOSED

Relent97 avatar Relent97 commented on July 28, 2024
App not updating

from pyodbc.

Comments (4)

kabirbaidhya avatar kabirbaidhya commented on July 28, 2024

@Relent97 Could you be more specific to the issue? Not sure what the issue is.

Let us know what the issue is, when do you get it and how you're using it and probably we can help you out. Thanks!

from pyodbc.

Relent97 avatar Relent97 commented on July 28, 2024

Hi @kabirbaidhya , Thanks for your response.

So the issue can be best be explained in an example. I built my docker image yesterday using the base Dockerfile in your repository with some minor changes.The container would build successfuly and run pulling the data from from a specified db in my Azure environment.
The problem is that, if i check the app today, the app does not pull any data for today from the DB. It's as if it only pulls data when the image is built and does not update itself hence losing it's dynamism.

Below is the syntax
FROM python:3.7-slim AS base

COPY requirements.txt .

Setup dependencies for pyodbc

RUN
export ACCEPT_EULA='Y' &&
export MYSQL_CONNECTOR='mysql-connector-odbc-8.0.18-linux-glibc2.12-x86-64bit' &&
export MYSQL_CONNECTOR_CHECKSUM='f2684bb246db22f2c9c440c4d905dde9' &&
apt-get update &&
apt-get install -y curl build-essential unixodbc-dev g++ apt-transport-https &&
gpg --keyserver hkp://keys.gnupg.net --recv-keys 5072E1F5 && \

Install pyodbc db drivers for MSSQL, PG and MySQL

curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - &&
curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list &&
curl -L -o ${MYSQL_CONNECTOR}.tar.gz https://dev.mysql.com/get/Downloads/Connector-ODBC/8.0/${MYSQL_CONNECTOR}.tar.gz &&
curl -L -o ${MYSQL_CONNECTOR}.tar.gz.asc https://downloads.mysql.com/archives/gpg/\?file\=${MYSQL_CONNECTOR}.tar.gz\&p\=10 &&
gpg --verify ${MYSQL_CONNECTOR}.tar.gz.asc &&
echo "${MYSQL_CONNECTOR_CHECKSUM} ${MYSQL_CONNECTOR}.tar.gz" | md5sum -c - &&
apt-get update &&
gunzip ${MYSQL_CONNECTOR}.tar.gz && tar xvf ${MYSQL_CONNECTOR}.tar &&
cp ${MYSQL_CONNECTOR}/bin/* /usr/local/bin && cp ${MYSQL_CONNECTOR}/lib/* /usr/local/lib &&
myodbc-installer -a -d -n "MySQL ODBC 8.0 Driver" -t "Driver=/usr/local/lib/libmyodbc8w.so" &&
myodbc-installer -a -d -n "MySQL ODBC 8.0" -t "Driver=/usr/local/lib/libmyodbc8a.so" &&
apt-get install -y msodbcsql17 odbc-postgresql && \

Update odbcinst.ini to make sure full path to driver is listed

sed 's/Driver=psql/Driver=/usr/lib/x86_64-linux-gnu/odbc/psql/' /etc/odbcinst.ini > /tmp/temp.ini &&
mv -f /tmp/temp.ini /etc/odbcinst.ini && \

Install dependencies

pip install --upgrade pip &&
pip install -r requirements.txt && rm requirements.txt && \

Cleanup build dependencies

rm -rf ${MYSQL_CONNECTOR}* &&
apt-get remove -y curl apt-transport-https debconf-utils g++ gcc rsync unixodbc-dev build-essential gnupg2 &&
apt-get autoremove -y && apt-get autoclean -y

RUN mkdir /app
WORKDIR /app

ADD requirements.txt /app/

RUN pip install -r requirements.txt

ADD . /app/

ENTRYPOINT ["python3", "app.py"]

from pyodbc.

kabirbaidhya avatar kabirbaidhya commented on July 28, 2024

@Relent97 I'm still not clear about your issue. Also, I don't think this issue is related to the laudio/pyodbc image since it seems you're not using it and are building your own using the dockerfile code as a reference. So, I'm closing this issue.

Anyway, I can suggest following:

  • You're creating your own image from scratch with python:3.7-slim as base - is this required? You could have used this image as a base or have extended from it in case you need custom chnages.
  • If you're looking for building your own image then perhaps you should go through the issue thread mkleehammer/pyodbc#276 and see if any other issues here answers your question https://github.com/mkleehammer/pyodbc/issues.

from pyodbc.

Relent97 avatar Relent97 commented on July 28, 2024

Thank you for the pointers @kabirbaidhya

from pyodbc.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.