Skip to content

Latest commit

 

History

History
22 lines (20 loc) · 710 Bytes

README.md

File metadata and controls

22 lines (20 loc) · 710 Bytes

docker-python-mssql

This repository provides a reference for connecting to a MSSQL database with Python/Pandas using Docker. Docker is used to avoid local dependencies on required MSSQL drivers.

Usage

Prepare query and credentials

  • Rename .env.example to .env and set the required environment variables.
  • Rename query.sql.example to query.sql and enter a valid query.

Build image

docker build -t python-mssql .

Run image

Run query/query.sql.

PowerShell/Ubuntu:

docker run --env-file=.env -v ${PWD}:/script python-mssql run.py query/query.sql

Windows Command Line (cmd):

docker run --env-file=.env -v %cd%:/script python-mssql run.py query/query.sql