Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
standardize the behaviour of the Docker images
- Loading branch information
1 parent
73d21e6
commit 8f0501b
Showing
5 changed files
with
37 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
# @FIXME The behaviour fo the MSSQL image differs slightly from the other images | ||
# To make it easier to setupm run tests and maintain we probably want to | ||
# standardize the behaviour of the Docker images, but not a priority yet. | ||
# There might be a third party image that does this out of the box | ||
# e.g. like the one from bitnami we use for mongodb | ||
# | ||
# * The default username is 'sa' | ||
# * No database is created by default | ||
version: '2' | ||
version: "2" | ||
|
||
services: | ||
|
||
mssql: | ||
image: mcr.microsoft.com/mssql/server:2017-latest | ||
restart: always | ||
environment: | ||
SA_PASSWORD: Pa55w0rd | ||
SA_PASSWORD: Pa55w0rd # minimum password complexity | ||
ACCEPT_EULA: Y | ||
ports: | ||
- "1433:1433" | ||
- "1433:1433" # map to non-default port, to avoid conflicts ? | ||
# WARN: command overrides, default image start sequence, start.sh starts 'sql-server' | ||
command: '/var/setup/start.sh' | ||
volumes: | ||
- ./mssql:/var/setup # mount setup files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env sh | ||
# see https://github.com/Microsoft/mssql-docker | ||
# no way to know when sql server is ready | ||
until /opt/mssql-tools/bin/sqlcmd -S 127.0.01 -U sa -P Pa55w0rd -d master -i /var/setup/setup.sql | ||
do sleep 1; | ||
done | ||
echo "NEXT_AUTH: setup completed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
USE master; | ||
if not exists (select name from sys.syslogins where name = 'nextauth') | ||
CREATE LOGIN nextauth | ||
WITH PASSWORD = 'password', | ||
CHECK_POLICY = OFF; | ||
GO | ||
if not exists (select name from sys.databases where name = 'nextauth' ) | ||
CREATE database nextauth | ||
GO | ||
USE nextauth; | ||
if not exists(select [name] from sys.sysusers where name= 'nextauth') | ||
CREATE USER nextauth FOR LOGIN nextauth | ||
WITH DEFAULT_SCHEMA =[dbo]; | ||
GO | ||
EXEC sp_addrolemember 'db_owner', 'nextauth' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
# launch setup on the background & start server | ||
# otherise sqlservr won't start | ||
/var/setup/setup.sh & /opt/mssql/bin/sqlservr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters