New: tooling_container

This commit is contained in:
2026-03-17 21:36:14 +01:00
parent 9ed7eb8e60
commit c489503403
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
FROM mcr.microsoft.com/mssql-tools
WORKDIR /App
# Copy everything
COPY ../../Einheit_1/2025_5BHITN_Konstantin_Hintermayer_create_schema.sql ./01.sql
COPY ../../Einheit_2/2025_5BHITN_Konstantin_Hintermayer_seed_database.sql ./02.sql
COPY ../../Einheit_3/2025_5BHITN_Konstantin_Hintermayer_procedures_and_triggers.sql ./03.sql
ENTRYPOINT ["sqlcmd", "-D", ""]

View File

@@ -0,0 +1,19 @@
#!/bin/bash
# Wait for SQL Server to boot up (adjust sleep if needed)
echo "Waiting for SQL Server to start..."
sleep 20s
# Run the three SQL files using sqlcmd
# -S: Server, -U: User, -P: Password (passed via ENV)
echo "Applying SQL files..."
for migration in $(ls . | grep -E '\.sql$')
do
echo "Applying $migration."
/opt/mssql-tools/bin/sqlcmd -D $DSN_PASSWORD -i $migration.sql
done
echo "Database initialization complete."
# Keep the container alive by bringing the background process to the foreground
wait