forked from thx/rap2-delos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
64 lines (58 loc) · 1.82 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
version: '2.2'
services:
delos:
container_name: rap2-delos
# build from ./Dockerfile
# build: .
# build from images
image: blackdog1987/rap2-delos:1.0.0
environment:
# if you have your own mysql, config it here, and disable the 'mysql' config blow
- MYSQL_URL=rap2-mysql # links will maintain /etc/hosts, just use 'container_name'
- MYSQL_PORT=3306
- MYSQL_USERNAME=root
- MYSQL_PASSWD=
- MYSQL_SCHEMA=rap2
# redis config
- REDIS_URL=rap2-redis
- REDIS_PORT=6379
# production / development
- NODE_ENV=production
working_dir: /app
privileged: true
###### '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
depends_on:
- redis
- mysql
ports:
- "38080:8080" # expose 38080
redis:
container_name: rap2-redis
image: redis:4.0.9
# disable this if you have your own mysql
mysql:
container_name: rap2-mysql
image: mysql:5.7.22
# expose 33306 to client (navicat)
#ports:
# - 33306:3306
volumes:
# change './docker/mysql/volume' to your own path
# WARNING: without this line, your data will be lost.
- "./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"
MYSQL_USER: "root"
MYSQL_PASSWORD: ""