lilishop-docker/docker-compose.yml

151 lines
4.1 KiB
YAML
Raw Normal View History

2021-05-13 16:15:40 +08:00
version: '3'
services:
mysql:
2021-09-15 15:49:19 +08:00
image: mysql:8.0.25
restart: always
2021-05-13 16:15:40 +08:00
container_name: mysql
volumes:
- ../volumes/data/mysqldata:/var/lib/mysql
2021-05-19 17:57:24 +08:00
- ./config/my.cnf:/etc/my.cnf
2021-05-13 16:15:40 +08:00
# 数据库还原目录 可将需要还原的sql文件放在这里
- ./init/mysql:/docker-entrypoint-initdb.d
environment:
- "MYSQL_ROOT_PASSWORD=lilishop"
- "MYSQL_DATABASE=lilishop"
- "TZ=Asia/Shanghai"
2022-03-01 09:13:39 +08:00
ports:
- 3306:3306
2021-09-15 15:49:19 +08:00
2021-05-13 16:15:40 +08:00
redis:
2021-09-15 15:49:19 +08:00
image: redis:6.2.5
2021-05-13 16:15:40 +08:00
restart: always
container_name: 'redis'
2021-05-13 16:15:40 +08:00
ports:
- 6379:6379
volumes:
- ../volumes/data/redsidata:/data
command: redis-server --port 6379 --requirepass lilishop --appendonly yes
elasticsearch:
image: elasticsearch:7.3.0
restart: always
container_name: elasticsearch
2021-05-13 16:15:40 +08:00
volumes:
# 映射本地目录权限一定要设置为 777 权限,否则启动不成功
- ../volumes/data/es7/logs:/usr/share/elasticsearch/logs:rw
- ../volumes/data/es7/data:/usr/share/elasticsearch/data:rw
2021-05-13 16:15:40 +08:00
- ./config/ik:/usr/share/elasticsearch/plugins/ik
# - "./elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml"
ports:
- "9200:9200"
- "9300:9300"
environment:
cluster.name: elasticsearch
discovery.type: single-node
2022-04-20 11:04:49 +08:00
ES_JAVA_OPTS: -Xms256m -Xmx256m
2021-05-13 16:15:40 +08:00
logging:
driver: "json-file"
options:
max-size: "50m"
networks:
- stack
ulimits:
nofile:
soft: 65535
hard: 65535
kibana:
image: docker.elastic.co/kibana/kibana:7.3.0
restart: always
2021-05-13 16:15:40 +08:00
container_name: kibana
ports:
- 5601:5601
2021-05-13 16:15:40 +08:00
# volumes:
# - "./config/kibana.yml:/usr/share/kibana/config/kibana.yml"
networks:
- stack
2021-05-28 16:22:02 +08:00
depends_on: ['elasticsearch']
logstash:
image: logstash:7.3.0
restart: always
2021-05-28 16:22:02 +08:00
container_name: logstash
volumes:
- ./config/logstash-springboot.conf:/usr/share/logstash/pipeline/logstash.conf #挂载logstash的配置文件
networks:
- stack
2021-05-13 16:15:40 +08:00
depends_on: ['elasticsearch']
ports:
- 4560:4560
2021-05-13 16:15:40 +08:00
# rocket mq name server
rmqnamesrv:
2021-09-15 15:49:19 +08:00
image: foxiswho/rocketmq:server-4.7.0
restart: always
2021-05-13 16:15:40 +08:00
container_name: rocket-server
environment:
JAVA_OPT_EXT: "-server -Xms64m -Xmx64m -Xmn64m"
volumes:
- ../volumes/data/rocket/server/logs:/opt/logs
- ../volumes/data/rocket/server/store:/opt/rmqstore
networks:
- rocketmq
ports:
- 9876:9876
2021-05-13 16:15:40 +08:00
# rocket mq broker
rmqbroker:
2021-09-15 15:49:19 +08:00
image: foxiswho/rocketmq:broker-4.7.0
restart: always
2021-05-13 16:15:40 +08:00
container_name: rocket-broker
volumes:
- ../volumes/data/rocket/broker/logs:/opt/logs
- ../volumes/data/rocket/broker/store:/opt/rmqstore
- ./config/broker.conf:/etc/rocketmq/broker.conf
environment:
- NAMESRV_ADDR=rmqnamesrv:9876
2021-05-13 16:15:40 +08:00
- JAVA_OPTS:=-Duser.home=/opt
- JAVA_OPT_EXT=-server -Xms64m -Xmx64m -Xmn64m
command: mqbroker -c /etc/rocketmq/broker.conf
depends_on:
- rmqnamesrv
networks:
- rocketmq
ports:
- 10909:10909
- 10911:10911
2021-05-13 16:15:40 +08:00
# rocket console 这个可以不需要
rmqconsole:
2021-09-15 15:49:19 +08:00
image: styletang/rocketmq-console-ng:latest
restart: always
2021-05-13 16:15:40 +08:00
container_name: rocket-console
environment:
- JAVA_OPTS=-Drocketmq.config.namesrvAddr=rmqnamesrv:9876 -Dserver.port=8180 -Drocketmq.config.isVIPChannel=false
2021-05-13 16:15:40 +08:00
- JAVA_OPT_EXT=-Xms128m -Xmx128m -Xmn128m
depends_on:
- rmqnamesrv
networks:
- rocketmq
ports:
- 8180:8180
2021-05-13 16:15:40 +08:00
# xxl-job 分布式调度中心
xxl-job:
2021-05-13 16:15:40 +08:00
image: xuxueli/xxl-job-admin:2.3.0
restart: always
2021-05-13 16:15:40 +08:00
container_name: xxl-job
network_mode: host
environment:
- PARAMS=--spring.datasource.url=jdbc:mysql://127.0.0.1:3306/lilishop?Unicode=true&characterEncoding=UTF-8 --spring.datasource.username=root --spring.datasource.password=lilishop --server.port=9001
depends_on:
- mysql
volumes:
- ../volumes/data/xxl-job:/data/applogs
2022-03-01 09:13:39 +08:00
ports:
- 9001:9001
2021-05-13 16:15:40 +08:00
networks:
rocketmq:
driver: bridge
2021-05-13 16:15:40 +08:00
stack:
driver: bridge