mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
docker: add mssql block
This commit is contained in:
parent
d4beee2bb0
commit
e7b790316e
5
docker/blocks/mssql/Dockerfile
Normal file
5
docker/blocks/mssql/Dockerfile
Normal file
@ -0,0 +1,5 @@
|
||||
FROM microsoft/mssql-server-linux:latest
|
||||
WORKDIR /usr/setup
|
||||
COPY . /usr/setup
|
||||
RUN chmod +x /usr/setup/setup.sh
|
||||
CMD /bin/bash ./entrypoint.sh
|
16
docker/blocks/mssql/docker-compose.yaml
Normal file
16
docker/blocks/mssql/docker-compose.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
mssqltest:
|
||||
build:
|
||||
context: blocks/mssql
|
||||
environment:
|
||||
ACCEPT_EULA: Y
|
||||
MSSQL_SA_PASSWORD: Password!
|
||||
MSSQL_PID: Express
|
||||
ports:
|
||||
- "1433:1433"
|
||||
|
||||
fake-mssql-data:
|
||||
image: grafana/fake-data-gen
|
||||
network_mode: bridge
|
||||
environment:
|
||||
FD_DATASOURCE: mssql
|
||||
FD_PORT: 1433
|
2
docker/blocks/mssql/entrypoint.sh
Normal file
2
docker/blocks/mssql/entrypoint.sh
Normal file
@ -0,0 +1,2 @@
|
||||
#start SQL Server and run setup script
|
||||
/usr/setup/setup.sh & /opt/mssql/bin/sqlservr
|
5
docker/blocks/mssql/setup.sh
Normal file
5
docker/blocks/mssql/setup.sh
Normal file
@ -0,0 +1,5 @@
|
||||
#/bin/bash
|
||||
|
||||
#wait for the SQL Server to come up
|
||||
sleep 20s
|
||||
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Password! -d master -i /usr/setup/setup.sql
|
14
docker/blocks/mssql/setup.sql
Normal file
14
docker/blocks/mssql/setup.sql
Normal file
@ -0,0 +1,14 @@
|
||||
CREATE LOGIN grafana WITH PASSWORD = 'Password!'
|
||||
GO
|
||||
|
||||
CREATE DATABASE grafana;
|
||||
GO
|
||||
|
||||
USE grafana;
|
||||
GO
|
||||
|
||||
CREATE USER grafana FOR LOGIN grafana;
|
||||
GO
|
||||
|
||||
EXEC sp_addrolemember 'db_owner', 'grafana';
|
||||
GO
|
Loading…
Reference in New Issue
Block a user