fix mysql charset

pull/153/head
blackdog1987 7 years ago committed by DongGuoChao
parent c83f426db9
commit f3455f3c3c

2
.gitignore vendored

@ -9,4 +9,4 @@ npm-debug.log
tmp
package-lock.json
dump.rdb
/mysql
/docker/mysql/volume

@ -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
@ -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"

Loading…
Cancel
Save