Permalink
Browse files

MySQL

  • Loading branch information...
massat committed Feb 28, 2017
1 parent 7346070 commit cc20b6a82c3d9a718ba732fd6d9c734912e17ccd
Showing with 37 additions and 0 deletions.
  1. +7 −0 db/00_schema.sql
  2. +8 −0 db/01_book.sql
  3. +22 −0 docker-compose.yml
View
@@ -0,0 +1,7 @@
+create table `book` (
+ `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `title` VARCHAR(256) NOT NULL,
+ `created` DATETIME NOT NULL,
+ `updated` DATETIME NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Innodb DEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci;
View
@@ -0,0 +1,8 @@
+SET CHARACTER SET utf8mb4;
+INSERT INTO `book` (`title`, `created`, `updated`) VALUES
+('ピアノの森', NOW(), NOW()),
+('ダンジョン飯', NOW(), NOW()),
+('花男', NOW(), NOW()),
+('蒼天航路', NOW(), NOW()),
+('SLAM DUNK', NOW(), NOW())
+;
View
@@ -0,0 +1,22 @@
+version: '2.1'
+services:
+ app:
+ build: .
+ ports:
+ - '9292:9292'
+ volumes:
+ - .:/app
+ links:
+ - mysql
+ mysql:
+ image: "mysql"
+ volumes:
+ - ./db:/docker-entrypoint-initdb.d
+ ports:
+ - "3306:3306"
+ environment:
+ MYSQL_ALLOW_EMPTY_PASSWORD: 1
+ MYSQL_DATABASE: app
+ MYSQL_USER: app
+ MYSQL_PASSWORD: app
+ command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --skip-character-set-client-handshake

0 comments on commit cc20b6a

Please sign in to comment.