-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
352 additions
and
20 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
# Ignore example backup files | ||
example/backup/ | ||
example/remote/ | ||
example/log/ | ||
|
||
# Ignore environment variable file | ||
example/.env |
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,25 @@ | ||
# Contribution Guidelines | ||
|
||
## GitHub Discussion | ||
|
||
Join [GitHub discussions on the BBT Software docker-mssql-backup repository](https://github.com/bbtsoftware/docker-mssql-backup/discussions) | ||
for questions and to discuss ideas & feature requests. | ||
|
||
## Contribute | ||
|
||
This repository uses [GitFlow] with default configuration. | ||
Development is happening on `develop` branch. | ||
|
||
To contribute: | ||
|
||
* Fork this repository. | ||
* Create a feature branch from `develop`. | ||
* Implement your changes. | ||
* Push your feature branch. | ||
* Create a pull request. | ||
|
||
> _We prefer the approach to create a pull-request per issue._ | ||
## Release | ||
|
||
[GitFlow]: (http://nvie.com/posts/a-successful-git-branching-model/) |
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
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
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
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
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,22 @@ | ||
TZ=Europe/Zurich | ||
DB_SERVER=db | ||
DB_USER=SA | ||
DB_PASSWORD=MySqlServerPassword1234 | ||
DB_NAMES=AdventureWorks2019 | ||
BACKUP_CLEANUP=true | ||
BACKUP_AGE=1 | ||
CRON_SCHEDULE=*/1 * * * * | ||
SKIP_BACKUP_LOG=false | ||
|
||
PACK="zip" | ||
ZIP_PASSWORD="ZipPassword1" | ||
PUSH_REMOTE_MODE="move" | ||
|
||
SMTP_HOST= | ||
SMTP_PORT= | ||
SMTP_AUTH=off | ||
SMTP_TLS=on | ||
SMTP_USER= | ||
SMTP_PASS= | ||
SMTP_FROM= | ||
MAIL_TO= |
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,20 @@ | ||
# Adventure Works Database on SQL Server 2019 | ||
FROM mcr.microsoft.com/mssql/server | ||
|
||
# Note: This isn't a secure password, and please don't use this for production. | ||
ENV SA_PASSWORD=MySqlServerPassword1234 | ||
ENV ACCEPT_EULA=Y | ||
|
||
ADD https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorksLT2019.bak /var/opt/mssql/backup/ | ||
|
||
USER root | ||
RUN chown -R mssql /var/opt/mssql/backup | ||
USER mssql | ||
|
||
# Launch SQL Server, confirm startup is complete, restore the database, then terminate SQL Server. | ||
RUN ( /opt/mssql/bin/sqlservr & ) | grep -q "Service Broker manager has started" \ | ||
&& sleep 5s \ | ||
&& /opt/mssql-tools/bin/sqlcmd -U sa -P ${SA_PASSWORD} -Q 'RESTORE DATABASE AdventureWorks2019 FROM DISK = "/var/opt/mssql/backup/AdventureWorksLT2019.bak" WITH MOVE "AdventureWorksLT2012_Data" to "/var/opt/mssql/data/AdventureWorks2019.mdf", MOVE "AdventureWorksLT2012_Log" to "/var/opt/mssql/data/AdventureWorks2019_log.ldf", NOUNLOAD, STATS = 5' \ | ||
&& /opt/mssql-tools/bin/sqlcmd -U sa -P ${SA_PASSWORD} -Q 'USE [AdventureWorks2019] ; ALTER DATABASE [AdventureWorks2019] SET RECOVERY FULL;' \ | ||
&& pkill sqlservr | ||
|
Oops, something went wrong.