{"id":15002896,"url":"https://github.com/felipedemacedo/python-3.7-with-pyodbc","last_synced_at":"2026-02-12T17:34:43.918Z","repository":{"id":86518100,"uuid":"206146054","full_name":"felipedemacedo/python-3.7-with-pyodbc","owner":"felipedemacedo","description":"Docker environment with Python 3.7 and pyodbc dependencies installed for connection with SQL Server database.","archived":false,"fork":false,"pushed_at":"2020-01-23T19:31:02.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-24T21:55:40.209Z","etag":null,"topics":["docker","docker-image","environment","environment-variables","mssql","mssql-database","mssqlserver","pyodbc","python","python3","sqlserver"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felipedemacedo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-03T18:31:20.000Z","updated_at":"2021-02-17T18:57:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"1e038051-f4b3-4882-a0bb-1a9d622c8b57","html_url":"https://github.com/felipedemacedo/python-3.7-with-pyodbc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/felipedemacedo/python-3.7-with-pyodbc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipedemacedo%2Fpython-3.7-with-pyodbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipedemacedo%2Fpython-3.7-with-pyodbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipedemacedo%2Fpython-3.7-with-pyodbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipedemacedo%2Fpython-3.7-with-pyodbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felipedemacedo","download_url":"https://codeload.github.com/felipedemacedo/python-3.7-with-pyodbc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipedemacedo%2Fpython-3.7-with-pyodbc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29374114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-image","environment","environment-variables","mssql","mssql-database","mssqlserver","pyodbc","python","python3","sqlserver"],"created_at":"2024-09-24T18:53:56.729Z","updated_at":"2026-02-12T17:34:43.901Z","avatar_url":"https://github.com/felipedemacedo.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python 3.7.4 + pyodbc (SQL Server)\n\n[Docker environment](https://hub.docker.com/r/felipederodrigues/python37withpyodbc) with Python 3.7 and pyodbc dependencies installed for connection with SQL Server database.\n\n## Dockerize your Python app using this environment\n\n### Create this Dockerfile (inside your Python app main directory)\n```java\nFROM felipederodrigues/python37withpyodbc:v1\n\nCOPY . /app\nWORKDIR /app\n\nRUN pip install --upgrade pip\nRUN python -m pip install -r requirements.txt\n\nENTRYPOINT [ \"python\", \"Main.py\" ]\n```\n### Create a Docker image with it. This image will have your app inside it (e.g.: /app directory).\n```java\ndocker build -t the-name-of-your-image:latest .\n```\n### Run your app: \n```java\ndocker run the-name-of-your-image:latest\n```\n\n## Suggestion\nAs a good practice, you can feed your app with environment variables for database connection.\nFor instance, you may call your application like this:\n```java\ndocker run \\\n    -e SQL_SERVER_SERVER=\"hostname.your.network\" \\\n    -e SQL_SERVER_DATABASE=\"YourDatabaseName\" \\\n    -e SQL_SERVER_USERNAME=\"YourDatabaseUsername\" \\\n    -e SQL_SERVER_PASSWORD=\"YourDatabasePassword\" \\\n    the-name-of-your-image:latest\n```\nAnd the code may pick this information up, without hardcoding credentials.\n```python\n@staticmethod\ndef connect_db():\n    \"\"\"        \n    Parameters\n    ----------\n    \"\"\"\n\n    print(\"Conecting to database ...\")\n    server = os.environ['SQL_SERVER_SERVER']\n    database = os.environ['SQL_SERVER_DATABASE']\n    username = os.environ['SQL_SERVER_USERNAME']\n    password = os.environ['SQL_SERVER_PASSWORD']\n    return db.DBConnection(server, database, username, password)\n```\n\n## Environment Info\n```\nroot@84e7f4ffff9e:/# python --version\nPython 3.7.4\nroot@84e7f4ffff9e:/# odbcinst -j\nunixODBC 2.3.4\nDRIVERS............: /etc/odbcinst.ini\nSYSTEM DATA SOURCES: /etc/odbc.ini\nFILE DATA SOURCES..: /etc/ODBCDataSources\nUSER DATA SOURCES..: /root/.odbc.ini\nSQLULEN Size.......: 8\nSQLLEN Size........: 8\nSQLSETPOSIROW Size.: 8\nroot@84e7f4ffff9e:/# uname -r\n4.9.125-linuxkit\nroot@84e7f4ffff9e:/# pip --version\npip 19.2.3 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)\n```\n\n## Special Thanks:\n- [@iuryxavier](https://github.com/iuryxavier)\n\n## Credits:\n- https://github.com/mkleehammer/pyodbc/wiki\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipedemacedo%2Fpython-3.7-with-pyodbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelipedemacedo%2Fpython-3.7-with-pyodbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipedemacedo%2Fpython-3.7-with-pyodbc/lists"}