Skip to content

Commit

Permalink
Merge cd769bf into 17db314
Browse files Browse the repository at this point in the history
  • Loading branch information
falkecarlsen authored Oct 1, 2021
2 parents 17db314 + cd769bf commit 6dd8f27
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docker/docker-compose.yml
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
24 changes: 24 additions & 0 deletions docker/restore-database-testenv.sh
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"

0 comments on commit 6dd8f27

Please sign in to comment.