This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dash | |
import dash_core_components as dcc | |
import dash_html_components as html | |
import plotly.express as px | |
import pandas as pd | |
from sqlalchemy import create_engine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ pip install --user pandas pyodbc dash sqlalchemy | |
Successfully installed Flask-1.1.2 ....... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker container list | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
e07d0406ca31 adventureworks:2019 "/opt/mssql/bin/perm…" 46 seconds ago Up 44 seconds 0.0.0.0:1633->1433/tcp adventureworks2019 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker run -p 1633:1433 --name adventureworks2019 -h adventureworks2019 -d adventureworks:2019 | |
e07d0406ca31eda958c9ed2a830bf83fea3c9d15ba2c43870410766a40a112d6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker build -t adventureworks:2019 | |
Sending build context to Docker daemon 334.3MB | |
Step 1/9 : FROM mcr.microsoft.com/mssql/server:2019-CU5-ubuntu-18.04 | |
---Removed--- | |
Processed 26344 pages for database 'AdventureWorks2019', file 'AdventureWorks2017' on file 1. | |
Processed 2 pages for database 'AdventureWorks2019', file 'AdventureWorks2017_log' on file 1. | |
RESTORE DATABASE successfully processed 26346 pages in 0.891 seconds (231.003 MB/sec). | |
Removing intermediate container 3cf414b336c4 | |
---> 7420ec09d77c | |
Step 9/9 : CMD ["/opt/mssql/bin/sqlservr"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adventure Works Database on SQL Server 2019 | |
FROM mcr.microsoft.com/mssql/server:2019-CU5-ubuntu-18.04 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Note: This isn't a secure password, and please don't use this for production. | |
ENV SA_PASSWORD=ThisIsAReallyCoolPassword123 | |
ENV ACCEPT_EULA=Y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setting the user | |
USER mssql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COPY AdventureWorks2019.bak /var/opt/mssql/backup/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Launch SQL Server, confirm startup is complete, restore the database, then terminate SQL Server. | |
RUN ( /opt/mssql/bin/sqlservr & ) | grep -q "Service Broker manager has started" \ | |
&& /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P ${SA_PASSWORD} -Q 'RESTORE DATABASE AdventureWorks2019 FROM DISK = "/var/opt/mssql/backup/AdventureWorks2019.bak" WITH MOVE "AdventureWorks2017" to "/var/opt/mssql/data/AdventureWorks2019.mdf", MOVE "AdventureWorks2017_Log" to "/var/opt/mssql/data/AdventureWorks2019_log.ldf", NOUNLOAD, STATS = 5' \ | |
&& pkill sqlservr |