From 71871244247aafcf583cc86928a3e82263624bb9 Mon Sep 17 00:00:00 2001 From: Daniel Harvey Date: Wed, 1 Nov 2023 11:51:56 +0000 Subject: [PATCH] Use sqlserver 2019 with healthcheck --- docker-compose.yaml | 20 ++++++++++++++------ justfile | 8 +++----- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index c2af53df..af4d5ad9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -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 diff --git a/justfile b/justfile index 7fe70040..7a12a878 100644 --- a/justfile +++ b/justfile @@ -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: @@ -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