Merge pull request #712 from cabrerabywaters/MSSQL_DATABASE_SUPPORT
adding MsSQL DATABASE support
This commit is contained in:
commit
6fa6d02360
|
@ -156,6 +156,20 @@ services:
|
|||
ports:
|
||||
- "${MYSQL_PORT}:3306"
|
||||
|
||||
### MsSQL Container #########################################
|
||||
|
||||
mssql:
|
||||
build:
|
||||
context: ./mssql
|
||||
environment:
|
||||
- MSSQL_DATABASE=${MSSQL_DATABASE}
|
||||
- SA_PASSWORD=${MSSQL_PASSWORD}
|
||||
- ACCEPT_EULA=Y
|
||||
volumes:
|
||||
- mssql:/var/opt/mssql
|
||||
ports:
|
||||
- "${MSSQL_PORT}:1433"
|
||||
|
||||
### MariaDB Container #######################################
|
||||
|
||||
mariadb:
|
||||
|
@ -381,6 +395,8 @@ services:
|
|||
volumes:
|
||||
mysql:
|
||||
driver: "local"
|
||||
mssql:
|
||||
driver: "local"
|
||||
postgres:
|
||||
driver: "local"
|
||||
memcached:
|
||||
|
|
|
@ -69,13 +69,17 @@ MYSQL_PASSWORD=secret
|
|||
MYSQL_PORT=3306
|
||||
MYSQL_ROOT_PASSWORD=root
|
||||
|
||||
### MSSQL Container
|
||||
MSSQL_DATABASE=homestead
|
||||
MSSQL_PASSWORD=yourStrong(!)Password
|
||||
MSSQL_PORT=1433
|
||||
|
||||
### MARIADB Container
|
||||
MARIADB_DATABASE=default
|
||||
MARIADB_USER=default
|
||||
MARIADB_PASSWORD=secret
|
||||
MARIADB_PORT=3306
|
||||
|
||||
|
||||
### POSTGRES Container
|
||||
POSTGRES_DB=default
|
||||
POSTGRES_USER=default
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
FROM microsoft/mssql-server-linux
|
||||
|
||||
# Create config directory
|
||||
# an set it as WORKDIR
|
||||
RUN mkdir -p /usr/src/app
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Bundle app source
|
||||
COPY . /usr/src/app
|
||||
|
||||
RUN chmod +x /usr/src/app/create_table.sh
|
||||
|
||||
ENV MSSQL_DATABASE=$MSSQL_DATABASE
|
||||
ENV ACCEPT_EULA=Y
|
||||
ENV SA_PASSWORD=$MSSQL_PASSWORD
|
||||
|
||||
VOLUME /var/opt/mssql
|
||||
|
||||
EXPOSE 1433
|
||||
|
||||
CMD /bin/bash ./entrypoint.sh
|
|
@ -0,0 +1,5 @@
|
|||
#wait for the SQL Server to come up
|
||||
sleep 45s
|
||||
|
||||
#run the setup script to create the DB and the schema in the DB
|
||||
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SA_PASSWORD -d master -i setup.sql
|
|
@ -0,0 +1,2 @@
|
|||
#start SQL Server, start the script to create the DB and import the data, start the app
|
||||
/opt/mssql/bin/sqlservr.sh & /usr/src/app/create_table.sh & tail -f /dev/null
|
|
@ -0,0 +1,4 @@
|
|||
CREATE DATABASE $(MSSQL_DATABASE);
|
||||
GO
|
||||
USE $(MSSQL_DATABASE);
|
||||
GO
|
Loading…
Reference in New Issue