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

Docker containerisation of stregsystemet #267

Draft
wants to merge 1 commit into
base: next
Choose a base branch
from
Draft
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
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"