mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
mssql image with setup script on entrypoint
This commit is contained in:
3
util/MsSql/.dockerignore
Normal file
3
util/MsSql/.dockerignore
Normal file
@ -0,0 +1,3 @@
|
||||
*
|
||||
!entrypoint.sh
|
||||
!setup.sql
|
7
util/MsSql/Dockerfile
Normal file
7
util/MsSql/Dockerfile
Normal file
@ -0,0 +1,7 @@
|
||||
FROM microsoft/mssql-server-linux
|
||||
|
||||
COPY setup.sql /
|
||||
|
||||
COPY entrypoint.sh /
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
7
util/MsSql/build.ps1
Normal file
7
util/MsSql/build.ps1
Normal file
@ -0,0 +1,7 @@
|
||||
$dir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
|
||||
echo "`n# Building MsSql"
|
||||
|
||||
echo "`nBuilding docker image"
|
||||
docker --version
|
||||
docker build -t bitwarden/mssql $dir\.
|
10
util/MsSql/build.sh
Normal file
10
util/MsSql/build.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
DIR="$(dirname $(readlink -f $0))"
|
||||
|
||||
echo -e "\n# Building MsSql"
|
||||
|
||||
echo -e "\nBuilding docker image"
|
||||
docker --version
|
||||
docker build -t bitwarden/mssql $DIR/.
|
4
util/MsSql/entrypoint.sh
Normal file
4
util/MsSql/entrypoint.sh
Normal file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
/opt/mssql/bin/sqlservr
|
||||
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P ${SA_PASSWORD} -i /setup.sql
|
6
util/MsSql/setup.sql
Normal file
6
util/MsSql/setup.sql
Normal file
@ -0,0 +1,6 @@
|
||||
USE [master]
|
||||
IF ((SELECT COUNT(1) FROM sys.databases WHERE [name] = 'vault') = 0)
|
||||
BEGIN
|
||||
CREATE DATABASE [vault]
|
||||
END
|
||||
GO
|
Reference in New Issue
Block a user