Skip to content

Commit

Permalink
Use sqlserver 2019 with healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljharvey committed Nov 1, 2023
1 parent 8da0175 commit 7187124
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
20 changes: 14 additions & 6 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
version: "3.6"

services:

sqlserver:
image: mcr.microsoft.com/azure-sql-edge
init: true # azure-sql-edge doesn't shut down properly without this
image: mcr.microsoft.com/mssql/server:2019-latest
platform: linux/amd64
ports:
- 64003:1433
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: "Password!"
MSSQL_SA_PASSWORD: "Password!"
MSSQL_PID: "Developer"
MSSQL_SA_PASSWORD: "Password!"
SA_PASSWORD: "Password!"
volumes:
- /var/opt/mssql
healthcheck:
test:
- CMD-SHELL
- |
/opt/mssql-tools/bin/sqlcmd -U SA -P "$$SA_PASSWORD"
start_period: 5s
interval: 5s
timeout: 10s
retries: 20

prometheus:
image: prom/prometheus
container_name: prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- "--config.file=/etc/prometheus/prometheus.yml"
ports:
- 9090:9090
restart: unless-stopped
Expand Down
8 changes: 3 additions & 5 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ generate-chinook-configuration: build
# run sqlserver
start-dependencies:
# start sqlserver
docker compose up -d sqlserver
docker compose down -v sqlserver
docker compose up --wait sqlserver
sqlcmd -S localhost,64003 -U SA -P "Password!" -i "./static/chinook-sqlserver.sql"

# run prometheus + grafana
start-metrics:
Expand All @@ -142,10 +144,6 @@ run-engine: start-dependencies
--bin engine -- \
--metadata-path ./static/chinook-metadata.json

import-chinook-dataset: start-dependencies
sqlcmd -S localhost,64003 -U SA -P "Password!" -i "./static/chinook-sqlserver.sql"
echo "chinook achieved"

# pasting multiline SQL into `sqlcmd` is a bad time, so here is a script to
# smash a file in for rapid fire application development business value
run-temp-sql: start-dependencies
Expand Down

0 comments on commit 7187124

Please sign in to comment.