-
Notifications
You must be signed in to change notification settings - Fork 18
Docker
If you not want to use the faf-stack or need to build the images by hand here the outdated readme.
Get docker.
Quick overview of Docker can be found: Docker Quick Start Guide
Build the container using
docker build -t faf-db .
Run using the following command. We recommend using the default values defined in config.py, where password
=banana
and db_name
=faf_test
. The port forwarding -p 3306:3006
is optional, but can be used to connect external tools running on your host system to the database, for instance MySQL Workbench.
docker run -d --name faf-db -e MYSQL_ROOT_PASSWORD=<wanted_password> -e MYSQL_DATABASE=<db_name> -p 3306:3306 faf-db
Check to see if running by looking at the container and netstat
docker ps
netstat -atn | grep 3306
Find containers IP (Container ID can be found under docker ps)
docker inspect <container_id> (IP is under IPAddress in NetworkSettings)
Import Structure and Data
cat db-structure.sql db-data.sql | docker exec -i faf-db mysql -uroot -p<wantedpassword> <db_name>
Now the database should be ready to go!
To get a shell mysql session where you can execute queries conveniently, use this
docker exec -ti faf-db mysql -u <username> -p