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