Skip to content

Commit

Permalink
fix mysql charset
Browse files Browse the repository at this point in the history
  • Loading branch information
blackdog1987 authored and blackdog1987 committed Apr 27, 2018
1 parent c83f426 commit f3455f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ npm-debug.log
tmp
package-lock.json
dump.rdb
/mysql
/docker/mysql/volume
13 changes: 10 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ services:
- NODE_ENV=production
working_dir: /app
privileged: true
command: node dispatch.js
###### 'sleep 30 && node scripts/init' will drop the tables
###### RUN ONLY ONCE THEN REMOVE 'sleep 30 && node scripts/init'
command: /bin/sh -c 'sleep 30; node scripts/init; node dispatch.js'
# init the databases
# command: sleep 30 && node scripts/init && node dispatch.js
# without init
# command: node dispatch.js
links:
- redis
- mysql
Expand All @@ -47,9 +53,10 @@ services:
#ports:
# - 33306:3306
volumes:
# change it to your own path
# change './docker/mysql/volume' to your own path
# WARNING: without this line, your data will be lost.
- "./mysql:/var/lib/mysql"
- "./docker/mysql/volume:/var/lib/mysql"
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --init-connect='SET NAMES utf8mb4;' --innodb-flush-log-at-trx-commit=0
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_DATABASE: "rap2"
Expand Down

0 comments on commit f3455f3

Please sign in to comment.