-
Notifications
You must be signed in to change notification settings - Fork 50
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
2 changed files
with
39 additions
and
0 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,15 @@ | ||
version: '3.1' | ||
|
||
services: | ||
|
||
db: | ||
image: mysql:5.7 | ||
restart: always | ||
environment: | ||
- MYSQL_DATABASE=stregsystem | ||
- MYSQL_ROOT_PASSWORD=juststars | ||
- MYSQL_USER=stregsystem | ||
- MYSQL_PASSWORD=hunter2 | ||
- MYSQL_ROOT_HOST=172.17.0.1 | ||
ports: | ||
- 3306:3306 |
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,24 @@ | ||
#!/bin/bash | ||
# | ||
# Script for setting up docker-stregsystem and reloading prod-database dump | ||
|
||
# be verbose | ||
set -x | ||
|
||
# path to mysql dump file after extraction from backup | ||
database_dump_path=stregsystem-db-2021-09-24.txt | ||
|
||
# password to use to restore backup | ||
mysql_root_password=juststars | ||
|
||
# set to empty (sudo='') if sudo is not required for your docker installation | ||
sudo='sudo ' | ||
|
||
# flush and setup environment | ||
$sudo docker-compose down && sudo docker-compose up -d | ||
|
||
printf "Wait for MySQL to start up in database [assuming 20s]\n" | ||
sleep 20 | ||
|
||
# remember to put "use stregsystem;" in backup before running | ||
printf -- "--\n-- Restore hotfix, must use stregsystem\n--\n\nuse stregsystem;\n" | cat - $database_dump_path | $sudo docker exec -i docker_db_1 sh -c "exec mysql -uroot -p$mysql_root_password" |