Skip to content

Commit

Permalink
feat($MySQL, docker-compose): init MySQL database automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnymillergh committed Jun 5, 2020
1 parent f0ce0f1 commit 68e0ddf
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docker/docker-compose.development-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ services:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: "jm@mysql"
MYSQL_DATABASE: muscle_and_fitness
TZ: Asia/Hong_Kong
ports:
- "3306:3306"
restart: always
volumes:
- /Users/johnny/docker-file-mapping/mysql-maf-dev_dkr:/var/lib/mysql
- ./mysql-init-script:/docker-entrypoint-initdb.d
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
networks:
muscle_and_fitness_network:
Expand Down
2 changes: 2 additions & 0 deletions docker/docker-compose.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ services:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: "jm@mysql"
MYSQL_DATABASE: muscle_and_fitness
TZ: Asia/Hong_Kong
ports:
- "3306:3306"
restart: always
volumes:
- /Users/johnny/docker-file-mapping/mysql-maf-prod:/var/lib/mysql
- ./mysql-init-script:/docker-entrypoint-initdb.d
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
networks:
muscle_and_fitness_network:
Expand Down
2 changes: 2 additions & 0 deletions docker/docker-compose.stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ services:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: "jm@mysql"
MYSQL_DATABASE: muscle_and_fitness
TZ: Asia/Hong_Kong
ports:
- "3306:3306"
restart: always
volumes:
- /Users/johnny/docker-file-mapping/mysql-maf-stage:/var/lib/mysql
- ./mysql-init-script:/docker-entrypoint-initdb.d
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
networks:
muscle_and_fitness_network:
Expand Down
2 changes: 2 additions & 0 deletions docker/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ services:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: "jm@mysql"
MYSQL_DATABASE: muscle_and_fitness
TZ: Asia/Hong_Kong
ports:
- "3306:3306"
restart: always
volumes:
- /Users/johnny/docker-file-mapping/mysql-maf-test:/var/lib/mysql
- ./mysql-init-script:/docker-entrypoint-initdb.d
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
networks:
muscle_and_fitness_network:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
-- the License.
--

CREATE DATABASE IF NOT EXISTS zipkin;

USE zipkin;

CREATE TABLE IF NOT EXISTS zipkin_spans (
`trace_id_high` BIGINT NOT NULL DEFAULT 0 COMMENT 'If non zero, this means the trace uses 128 bit traceIds instead of 64 bit',
`trace_id` BIGINT NOT NULL,
Expand Down

0 comments on commit 68e0ddf

Please sign in to comment.