Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt add mssql #70

Merged
merged 1 commit into from
May 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion .docker/mssql/simple-db.sh
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
#!/bin/bash
#!/bin/bash
# --------------------------------------
# Creating databases
filename=/tmp/initdb/dump/create.pgsql.sql
database="dao"
host="dao_mssql"
password="$SA_PASSWORD"


mssql -u sa -p $password

psql -U postgres_user -c 'DROP DATABASE dao'

if psql -U postgres_user -w -lqtA | cut -d \| -f 1 | grep "dao";
then
echo "DB "dao" already exists";
else
PGPASSWORD=postgres_pass createdb -U postgres_user -w dao;
fi

#sleep 5;
#echo "Creating "$database" database..."
#psql \
#--user='root' \
#--execute "DROP DATABASE IF EXISTS $database; CREATE DATABASE $database;"
#echo "Done!"

# Importing dumps
echo "Importing "$database" database..\n"
export PGPASSWORD=$password
psql \
-h $host \
-U "${POSTGRES_USER}" \
-d $database < $filename
echo "Done!"
9 changes: 5 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,15 @@ services:

dao_mssql:
container_name: ${APP_COMPOSE_PROJECT_NAME}_mssql_db
image: 'mcr.microsoft.com/mssql/server'
image: mcr.microsoft.com/mssql/server:2019-latest
user: root
ports:
- '1433:1433'
- 1433:1433
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=mssql_rootpw
- SA_PASSWORD=Mssql_Rootpw!
volumes:
- dao_mssql_db:/var/opt/mssql
- dao_mssql_db:/var/opt/mssql/data

networks:
dao-network:
Expand Down