This repository was archived by the owner on Jul 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +14
-36
lines changed
Expand file tree Collapse file tree 4 files changed +14
-36
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ services:
2525 azurite :
2626 condition : service_healthy
2727 db :
28- condition : service_healthy
28+ condition : service_started
2929 networks :
3030 - backend
3131
@@ -61,12 +61,12 @@ services:
6161 - " 1433:1433"
6262 volumes :
6363 - db-data:/var/opt/mssql
64- healthcheck :
65- test : ["CMD-SHELL", "/opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P \"${DATABASE_PASSWORD}\" -Q \"SELECT 1;\" || exit 1"]
66- interval : 20s
67- timeout : 10s
68- retries : 6
69- start_period : 60s
64+ # healthcheck:
65+ # test: ["CMD-SHELL", "/opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P \"${DATABASE_PASSWORD}\" -Q \"SELECT 1;\" || exit 1"]
66+ # interval: 20s
67+ # timeout: 10s
68+ # retries: 6
69+ # start_period: 60s
7070 networks :
7171 - backend
7272
@@ -80,7 +80,7 @@ services:
8080 DATABASE_PASSWORD : " ${DATABASE_PASSWORD}"
8181 depends_on :
8282 db :
83- condition : service_healthy
83+ condition : service_started
8484 networks :
8585 - backend
8686
Original file line number Diff line number Diff line change 1- # Use official Microsoft SQL Server image as base
2- FROM mcr.microsoft.com/mssql/server:2022-latest
1+ FROM mcr.microsoft.com/mssql-tools
32
4- # Switch to root to change file permissions
5- USER root
6-
7- # Copy the setup script and SQL file to /database inside the container
8- COPY db-setup-entrypoint.sh /database/db-setup-entrypoint.sh
9- COPY create_database_statement.sql /database/create_database_statement.sql
10-
11- # Make sure the entrypoint script is executable
3+ WORKDIR /database
4+ COPY . /database
125RUN chmod +x /database/db-setup-entrypoint.sh
13-
14- # Switch back to the default non-root SQL Server user
15- USER mssql
16-
17- # Run the entrypoint script when the container starts
186ENTRYPOINT ["/database/db-setup-entrypoint.sh" ]
Original file line number Diff line number Diff line change 44IF NOT EXISTS (
55 SELECT name
66 FROM sys .databases
7- WHERE name = N ' PathwayCoordinator '
7+ WHERE name = N ' Test '
88 )
9- CREATE DATABASE [PathwayCoordinator ];
9+ CREATE DATABASE [Test ];
1010GO
1111
1212IF SERVERPROPERTY (' ProductVersion' ) > ' 12'
13- ALTER DATABASE [PathwayCoordinator ] SET QUERY_STORE = ON ;
13+ ALTER DATABASE [Test ] SET QUERY_STORE = ON ;
1414GO
Original file line number Diff line number Diff line change 11#! /bin/bash
22echo " 🔧 Starting DB setup..."
33
4- # Verify that the script is executable
5- if [ ! -x /database/db-setup-entrypoint.sh ]; then
6- echo " ❌ Entry point script is not executable"
7- exit 1
8- fi
9-
10- # Verify the content of the script is present and not empty
11- echo " 📄 Content of the script:"
12- cat /database/db-setup-entrypoint.sh
13-
144# Check if the SQL script exists
155if [ ! -f /database/create_database_statement.sql ]; then
166 echo " ❌ SQL script not found!"
You can’t perform that action at this time.
0 commit comments