Browse Source

docker-compose

master
Shuaishuai Dai 2 years ago
commit
d67230f3b7
  1. 11
      config/kibana/kibana.yml
  2. 1832
      config/redis/redis.conf
  3. 0
      data/elasticsearch/.gitkeep
  4. 0
      data/redis/.gitkeep
  5. 132
      docker-compose.yml
  6. 3
      dockerfile/DockerfileRedis
  7. 0
      logs/xxl-job/.gitkeep

11
config/kibana/kibana.yml

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
#
# ** THIS IS AN AUTO-GENERATED FILE **
#
# Default Kibana configuration for docker target
server.name: kibana
server.host: "0"
elasticsearch.hosts: [ "http://lottery-elasticsearch:9200" ]
xpack.monitoring.ui.container.elasticsearch.enabled: true
# 设置中文显示
i18n.locale: "zh-CN"

1832
config/redis/redis.conf

File diff suppressed because it is too large Load Diff

0
data/elasticsearch/.gitkeep

0
data/redis/.gitkeep

132
docker-compose.yml

@ -0,0 +1,132 @@ @@ -0,0 +1,132 @@
version: '3'
services:
#redis服务
lottery-redis:
#构建镜像
build:
context: ./
dockerfile: dockerfile/DockerfileRedis
container_name: lottery-redis
ports:
- 6379:6379
volumes:
- ./config/redis/redis.conf:/etc/redis/redis.conf
- ./data/redis:/data
networks:
- lottery-net
restart: on-failure:3
command: redis-server --appendonly yes #开启持久化
#zk
lottery-zookeeper:
image: wurstmeister/zookeeper
container_name: lottery-zookeeper
ports:
- 2181:2181
networks:
- lottery-net
restart: on-failure:3
#kafka
lottery-kafka:
image: wurstmeister/kafka
container_name: lottery-kafka
ports:
- 9092:9092
environment:
- KAFKA_BROKER_ID=0
- KAFKA_ZOOKEEPER_CONNECT=lottery-zookeeper:2181
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://150.158.183.74:9092
- KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092
networks:
- lottery-net
restart: on-failure:3
depends_on: #等待zk启动后启动kafka
- lottery-zookeeper
#mysql
lottery-mysql:
image: mysql:latest
container_name: lottery-mysql
ports:
- 3306:3306
networks:
- lottery-net
environment:
- MYSQL_ROOT_PASSWORD=123456
restart: on-failure:3
#nacos
lottery-nacos:
image: nacos/nacos-server:2.0.3
container_name: lottery-nacos
ports:
- 8848:8848
networks:
- lottery-net
environment:
- MODE=standalone
- MYSQL_SERVICE_HOST=lottery-mysql
- MYSQL_SERVICE_PORT=3306
- MYSQL_SERVICE_DB_NAME=nacos
- MYSQL_SERVICE_USER=nacos
- MYSQL_SERVICE_PASSWORD=nacos
depends_on:
- lottery-mysql
restart: on-failure:3
#elasticsearch
lottery-elasticsearch:
image: elasticsearch:7.6.2
container_name: lottery-elasticsearch
ports:
- 9200:9200
- 9300:9300
networks:
- lottery-net
environment:
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms128m -Xmx256m
- http.host=0.0.0.0
privileged: true
volumes:
- ./data/elasticsearch:/usr/share/elasticsearch/data
- es-plugins:/usr/share/elasticsearch/plugins
depends_on:
- lottery-mysql
restart: on-failure:3
#kibana
lottery-kibana:
image: kibana:7.6.2
container_name: lottery-kibana
ports:
- 5601:5601
networks:
- lottery-net
environment:
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms128m -Xmx256m
- http.host=0.0.0.0
privileged: true
volumes:
- ./config/kibana/kibana.yml:/usr/share/kibana/config/kibana.yml
depends_on:
- lottery-elasticsearch
- lottery-xxl-job
restart: on-failure:3
#xxl-job
lottery-xxl-job:
image: xuxueli/xxl-job-admin:2.3.0
container_name: lottery-xxl-job
ports:
- 7397:7397
networks:
- lottery-net
environment:
- PARAMS=" --server.port=7397 --spring.datasource.url=jdbc:mysql://lottery-mysql:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8 --spring.datasource.username=xxl_job --spring.datasource.password=xxl_job --xxl.job.accessToken=xxl_job"
volumes:
- ./logs/xxl-job:/data/applogs
depends_on:
- lottery-xxl-job
restart: on-failure:3
networks:
lottery-net:
external: true
volumes:
#解决ERROR: Named volume "es-plugins:/usr/share/elasticsearch/plugins:rw" is used in service "lottery-elasticsearch" but no declaration was found in the volumes section.
es-plugins:

3
dockerfile/DockerfileRedis

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
FROM redis:latest
COPY config/redis/redis.conf /etc/redis/redis.conf
CMD [ "redis-server", "/etc/redis/redis.conf" ]

0
logs/xxl-job/.gitkeep

Loading…
Cancel
Save