You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rap2-delos/docker-compose.yml

70 lines
1.9 KiB
YAML

7 years ago
# mail@dongguochao.com
# llitfkitfk@gmail.com
7 years ago
version: "3"
7 years ago
services:
# frontend
nginx:
# image: nginx:stable-alpine
build:
# will use image from the frontend repo in the future
context: docker/frontend
volumes:
- ./docker/nginx/conf.d:/etc/nginx/conf.d
ports:
- 38080:38080
- 38081:38081
# backend
7 years ago
delos:
# build from ./Dockerfile
build: .
7 years ago
# build from images
# you can find last tag from https://hub.docker.com/r/blackdog1987/rap2-delos
# image: blackdog1987/rap2-delos:2.6.aa3be03
7 years ago
environment:
# if you have your own mysql, config it here, and disable the 'mysql' config blow
- MYSQL_URL=mysql # links will maintain /etc/hosts, just use 'container_name'
7 years ago
- MYSQL_PORT=3306
- MYSQL_USERNAME=root
- MYSQL_PASSWD=
- MYSQL_SCHEMA=rap2
# redis config
- REDIS_URL=redis
7 years ago
- REDIS_PORT=6379
# production / development
- NODE_ENV=production
###### 'sleep 30 && node scripts/init' will drop the tables
###### RUN ONLY ONCE THEN REMOVE 'sleep 30 && node scripts/init'
command: /bin/sh -c 'node dispatch.js'
# init the databases
# command: sleep 30 && node scripts/init && node dispatch.js
# without init
# command: node dispatch.js
7 years ago
depends_on:
- redis
- mysql
redis:
image: redis:4
7 years ago
# disable this if you have your own mysql
mysql:
image: mysql:5.7
7 years ago
# expose 33306 to client (navicat)
#ports:
# - 33306:3306
volumes:
# change './docker/mysql/volume' to your own path
7 years ago
# 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
7 years ago
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_DATABASE: "rap2"
MYSQL_USER: "root"
MYSQL_PASSWORD: ""