mirror of
https://github.com/bitwarden/server.git
synced 2025-02-16 01:51:21 +01:00
mssql image with setup script on entrypoint
This commit is contained in:
parent
a222613082
commit
1fd7f5dd03
@ -9,4 +9,5 @@ echo "=================="
|
||||
& $dir\util\Server\build.ps1
|
||||
& $dir\util\Nginx\build.ps1
|
||||
& $dir\util\Attachments\build.ps1
|
||||
& $dir\util\MsSql\build.ps1
|
||||
& $dir\util\Setup\build.ps1
|
||||
|
1
build.sh
1
build.sh
@ -11,4 +11,5 @@ $DIR/src/Identity/build.sh
|
||||
$DIR/util/Server/build.sh
|
||||
$DIR/util/Nginx/build.sh
|
||||
$DIR/util/Attachments/build.sh
|
||||
$DIR/util/MsSql/build.sh
|
||||
$DIR/util/Setup/build.sh
|
||||
|
@ -2,7 +2,7 @@ version: '3'
|
||||
|
||||
services:
|
||||
mssql:
|
||||
image: microsoft/mssql-server-linux
|
||||
image: bitwarden/mssql
|
||||
container_name: mssql
|
||||
restart: always
|
||||
ports:
|
||||
@ -26,6 +26,7 @@ services:
|
||||
identity:
|
||||
image: bitwarden/identity
|
||||
container_name: identity
|
||||
restart: always
|
||||
|
||||
nginx:
|
||||
image: bitwarden/nginx
|
||||
|
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
|
Loading…
Reference in New Issue
Block a user