1
0
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:
Kyle Spearrin
2017-08-17 22:28:56 -04:00
parent a222613082
commit 1fd7f5dd03
9 changed files with 41 additions and 1 deletions

3
util/MsSql/.dockerignore Normal file
View File

@ -0,0 +1,3 @@
*
!entrypoint.sh
!setup.sql

7
util/MsSql/Dockerfile Normal file
View 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
View 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
View 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
View 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
View File

@ -0,0 +1,6 @@
USE [master]
IF ((SELECT COUNT(1) FROM sys.databases WHERE [name] = 'vault') = 0)
BEGIN
CREATE DATABASE [vault]
END
GO