1 Star 0 Fork 3

天灏 / tools-docker

forked from 容器化 / tools-docker 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

说明

在研发环境中,我们要安装各种中间件来支持我们的程序运行,但是一个一个的安装配置起来非常的麻烦和浪费时间,所以我们使用编排工具做到一键命令安装好所有我们所需的中间件,简单省事。

开始

使用一键安装之前先确保是否安装Docker https://blog.csdn.net/lulongji2035/article/details/107983973

确定是否安装Docker-compose https://blog.csdn.net/lulongji2035/article/details/107984037

确保docker和docker-compose安装好之后到gitee上动动你的小手点击star 和fork。 在这里插入图片描述

下载 https://gitee.com/Bruce-Tools/tools-docker.git 到服务上 并在第四个docker中间件配置目录下执行docker-compose命令安装相关中间件。 在这里插入图片描述

命令如下:

docker-compose up -d 

如果只是安装一个中间件,则注释掉其他的或者执行如下命令:

#示例只安装nginx
docker-compose up -d nginx

安装完成后 在这里插入图片描述

使用

redis

host:当前服务器ip
密码:123456 端口:6379

mysql

host:当前服务器ip
账号:root 密码:root 端口:3306

rabbitmq

host:当前服务器ip
账号:guest 密码:guest 端口:默认

其他的请根据docker-compose自行适配

docker-compose.yml

version: '3'

services:
###################nginx###########################
nginx:
  restart: always
  image: nginx
  container_name: nginx
  ports:
    - 80:80
    - 443:443
  volumes:
    - /etc/localtime:/etc/localtime:ro
    - /etc/hosts:/etc/hosts:ro
    - ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
    - ./nginx/conf.d:/etc/nginx/conf.d
    - ./nginx/logs:/var/log/nginx
    - ./nginx/html:/usr/share/nginx/html
    - ./nginx/etc/letsencrypt:/etc/letsencrypt
    - ./nginx/conf:/etc/nginx
  network_mode: "host"
###################redis###########################
redis:
  image: redis
  container_name: redis
  ports:
    - 6379:6379
  restart: always
  command: redis-server --requirepass 123456 --dir /data
  volumes:
    - /etc/localtime:/etc/localtime:ro
    - /etc/hosts:/etc/hosts:ro
    - ./redis/data:/data
    - ./redis/conf/redis.conf:/etc/redis/redis.conf
  network_mode: "host"

###################mysql###########################
mysql:
  restart: always
  image: mysql:5.7
  container_name: mysql
  privileged: true
  command: --default-authentication-plugin=mysql_native_password #这行代码解决无法访问的问题
  ports:
    - 3306:3306
  environment:
    MYSQL_ROOT_PASSWORD: root
  volumes:
    - /etc/localtime:/etc/localtime:ro
    - /etc/hosts:/etc/hosts:ro
    - ./mysql/data:/var/lib/mysql
    - ./mysql/conf/my.cnf:/etc/mysql/my.cnf
  network_mode: "host"


  ###################mycat###########################
  mycat:
    restart: always
    image: longhronshens/mycat-docker
    build: ./mycat
    container_name: mycat
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /etc/hosts:/etc/hosts
      - ./mycat/conf:/usr/local/mycat/conf
    ports:
      - 8066:8066 # 暴露mycat服务端口
      - 9066:9066 # 暴露mycat管理端口
    network_mode: "host"

###################rabbitmq###########################
rabbitmq:
  restart: always
  image: rabbitmq:management
  container_name: rabbitmq
  privileged: true
  ports:
    - 4369:4369
    - 5671:5671
    - 5672:5672
    - 15672:15672
    - 25672:25672
  environment:
    RABBITMQ_DEFAULT_VHOST: /
    RABBITMQ_DEFAULT_USER: guest
    RABBITMQ_DEFAULT_PASS: guest
    RABBITMQ_LOGS: /var/lib/rabbitmq/rabbitmq.log
    RABBITMQ_SASL_LOGS: /var/lib/rabbitmq/rabbitmq-sasl.log
    RABBITMQ_ERLANG_COOKIE: LZJADKXKLULIXFKAALGX
  logging:
    driver: "json-file"
    options:
      max-size: "200k"
      max-file: "10"
  volumes:
    - /etc/localtime:/etc/localtime:ro
    - /etc/hosts:/etc/hosts:ro
    - ./rabbitmq:/var/lib/rabbitmq
  network_mode: "host"

###################fdfs###########################
tracker:
  restart: always
  image: morunchang/fastdfs
  container_name: tracker
  hostname: tracker
  entrypoint: sh ./tracker.sh
  ports:
    - "22122:22122"
  volumes:
    - /etc/localtime:/etc/localtime:ro
    - /etc/hosts:/etc/hosts:ro
    - /app/im_attach/fdfs:/data/fast_data
  network_mode: "host"

storage:
  restart: always
  image: morunchang/fastdfs
  container_name: storage
  hostname: storage
  entrypoint: sh ./storage.sh
  ports:
    - 9999:9999
    - 23000:23000
  volumes:
    - /app/im_attach/fdfs:/data/fast_data
    - ./fastdfs/nginx.conf:/etc/nginx/conf/nginx.conf
  environment:
    - "TRACKER_IP=192.168.183.133:22122"
    - "GROUP_NAME=group1"
  network_mode: "host"

 ###################influxdb###########################
influxdb:
  image: influxdb:latest
  container_name: tig-influxdb
  ports:
    - "8083:8083"
    - "8086:8086"
    - "8090:8090"
  env_file:
    - 'env.influxdb'
  volumes:
    - ./influxdb/data:/var/lib/influxdb
    - ./etc/timezone:/etc/timezone:ro
    - /etc/hosts:/etc/hosts:ro
    - ./etc/localtime:/etc/localtime:ro
  restart: unless-stopped
  network_mode: "host"


  ###################grafana###########################
grafana:
  image: grafana/grafana
  container_name: grafana
  environment:
    - GF_AUTH_ANONYMOUS_ENABLED=true #公开仪表板
  ports:
    - 3000:3000
  volumes:
    - ./grafana/data:/var/lib/grafana
    - ./etc/timezone:/etc/timezone:ro
    - /etc/hosts:/etc/hosts:ro
    - ./etc/localtime:/etc/localtime:ro
  restart: unless-stopped
  network_mode: "host"

感谢

本文只做学习参考,如有任何不准确的地方欢迎指正。

空文件

简介

docker 安装 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/skygefgko/tools-docker.git
git@gitee.com:skygefgko/tools-docker.git
skygefgko
tools-docker
tools-docker
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891