Parcourir la source

:whale: Work about Docker. add mysql dockerfile

冷冷 il y a 6 ans
Parent
commit
bcc1d668f4
5 fichiers modifiés avec 24 ajouts et 0 suppressions
  1. 5 0
      doc/db/1schema.sql
  2. 1 0
      doc/db/pigxx.sql
  3. 1 0
      doc/db/pigxx_ac.sql
  4. 5 0
      doc/db/Dockerfile
  5. 12 0
      docker-compose.yml

+ 5 - 0
doc/db/1schema.sql

@@ -0,0 +1,5 @@
+-- pigx 核心表
+create database `pigxx` default character set utf8mb4 collate utf8mb4_general_ci;
+
+-- pigx 工作流相关库
+create database `pigxx_acl` default character set utf8mb4 collate utf8mb4_general_ci;

+ 1 - 0
doc/db/pigxx.sql

@@ -13,6 +13,7 @@
 
  Date: 11/28/2018 16:11:29 PM
 */
+USE pigxx;
 
 SET NAMES utf8;
 SET FOREIGN_KEY_CHECKS = 0;

+ 1 - 0
doc/db/pigxx_ac.sql

@@ -13,6 +13,7 @@
 
  Date: 12/04/2018 00:03:49 AM
 */
+USE pigxx_acl;
 
 SET NAMES utf8;
 SET FOREIGN_KEY_CHECKS = 0;

+ 5 - 0
doc/db/Dockerfile

@@ -0,0 +1,5 @@
+FROM mysql:5.7
+MAINTAINER lengleng(wangiegie@gmail.com)
+COPY 1schema.sql /docker-entrypoint-initdb.d
+COPY 2pigxx.sql /docker-entrypoint-initdb.d
+COPY 3pigxx_ac.sql /docker-entrypoint-initdb.d

+ 12 - 0
docker-compose.yml

@@ -1,5 +1,17 @@
 version: '2'
 services:
+  pigx-mysql:
+    build:
+      context: ./
+      dockerfile: ./doc/db/Dockerfile
+    environment:
+      MYSQL_ROOT_PASSWORD: root
+    restart: always
+    container_name: pigx-mysql
+    image: pigx-mysql
+    ports:
+      - 3306:3306
+
   pigx-zookeeper:
     image: zookeeper:3.4.13
     ports: