docker run --name db -e MYSQL_ROOT_PASSWORD=test -d -p 3306:3306 mariadb
docker run --name mysql-client -it --link db:mysql --rm mariadb sh -c 'exec mysql -uroot -ptest -hmysql'
Once inside MySQL:
CREATE DATABASE my_flask_app;
USE my_flask_app;
CREATE TABLE user(
user_id INT NOT NULL AUTO_INCREMENT,
username VARCHAR(64) NOT NULL,
password VARCHAR(64) NOT NULL,
PRIMARY KEY(user_id)
);
INSERT INTO user VALUES('', 'jorge', '12345');
docker build -t flask-intro-mysql .
docker run -d -p 5000:5000 -v /Users/jorge/flask-intro:/opt/flask-intro --name web --link db:mysql flask-intro-mysql