1 Star 0 Fork 0

丁晓林/多数据库一键部署

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
docker-compose.yml 6.73 KB
一键复制 编辑 原始数据 按行查看 历史
dxlani 提交于 2021-12-16 11:47 . mqtt
version: '3'
services:
# nginx:
# container_name: nginx
# image: nginx
# restart: always
# ports:
# - 80:80
# privileged: true
# volumes:
# - ./server/nginx/nginx.conf:/etc/nginx/nginx.conf
# - ./server/nginx/default.conf:/etc/nginx/conf.d/default.conf
# - ./html/dist/:/usr/share/nginx/html/
# networks:
# - myweb
#   deploy:
# replicas: 2
# resources:
# limits:
# cpus: '2'
# memory: 4G
# vsftpd:
# image: "fauria/vsftpd"
# volumes:
# - ./server/ftp:/home/vsftpd
# ports:
# - "20:20"
# - "21:21"
# - "21100-21110:21100-21110"
# environment:
# - FTP_USER=root
# - FTP_PASS=123456
# - PASV_ADDRESS=119.45.5.34
# - PASV_MIN_PORT=21100
# - PASV_MAX_PORT=21110
# sftp:
# image: atmoz/sftp
# volumes:
# - /opt/docker-common/sftp:/home/upload
# #- /opt/docker-common/sftp/users.conf:/etc/sftp/users.conf:ro
# environment:
# TZ: Asia/Shanghai
# ports:
# - "22:22"
# command: root:123456:::upload
# container_name: sftp
# networks:
# - default
mongo:
image: mongo
container_name: mongo
restart: always
privileged: true
volumes:
- /etc/localtime:/etc/localtime:ro
- ./server/mongo/data:/data/db # /data/db是container中存放数据位置
- ./server/mongo/:/docker-entrypoint-initdb.d/ # 本地文件路径:容器内映射路径
environment:
TZ: Asia/Shanghai
ports:
- 27017:27017
networks:
- default
# mongo-express:
# image: mongo-express
# container_name: mongo-express
# restart: always
# privileged: true
# environment:
# ME_CONFIG_BASICAUTH_USERNAME: root
# ME_CONFIG_BASICAUTH_PASSWORD: 123456
# links:
# - mongo # 关联mongo
# ports:
# - 27018:8081
# networks:
# - default
mysql:
image: mysql:5.7
container_name: mysql
restart: always
privileged: true
environment:
TZ: Asia/Shanghai
MYSQL_ROOT_PASSWORD: dxlani001
command:
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true
--lower_case_table_names=1
--max_allowed_packet=128M
--sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO"
ports:
- 3306:3306
volumes:
- ./server/mysql/data:/var/lib/mysql
- /etc/localtime:/etc/localtime
networks:
- default
# phpmyadmin:
# image: "phpmyadmin/phpmyadmin"
# container_name: "phpmyadmin"
# restart: always
# ports:
# - "3307:80"
# environment:
# PMA_ARBITRARY: 1 #一定要写,用于填写数据库地址
# networks:
# - default
codegen: #springboot代码生成器
image: tanghc2020/gen
container_name: gen
restart: always
ports:
- "6969:6969"
redis:
image: redis:6.0 # redis
container_name: redis #生成的容器名称
restart: always #生成的容器名称
privileged: true #解决权限
volumes:
- ./server/redis/redis.conf:/etc/redis/redis.conf #映射本地配置文件
- ./server/redis/db/:/data/ #持久化存储
command: redis-server --appendonly yes --requirepass dxlani001 # 开启AOF模式 打开redis持久化配置,设置密码
environment:
- TZ=Asia/Shanghai
ports:
- 6379:6379
# treenms:
# image: fuyong/treenms #redis管理工具
# container_name: treenms #生成的容器名称
# restart: always #生成的容器名称
# privileged: true #解决权限 默认用户名:treesoft,密码:treesoft ,用户:admin,密码:treesoft
# volumes:
# - /etc/localtime:/etc/localtime
# environment:
# - TZ=Asia/Shanghai
# ports:
# - 6380:8080
postgres:
image: postgres:12.0 #pgsql
container_name: postgres
restart: always
privileged: true
volumes:
- ./server/postgres/data:/var/lib/postgresql/data/pgdata
environment:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: dxlani001
PGDATA: /var/lib/postgresql/data/pgdata # 数据存储文件夹
ports:
- 5432:5432
# rabbitmq:
# image: rabbitmq:3.8.3-management
# container_name: rabbitmq
# restart: always
# volumes:
# - ./server/postgres/data:/var/lib/rabbitmq
# environment:
# - RABBITMQ_DEFAULT_USER=root
# - RABBITMQ_DEFAULT_PASS=123456
# ports:
# - 15672:15672
# - 5672:5672
# influxdb:
# image: influxdb
# container_name: influxdb
# volumes:
# - ./server/influxdb/conf:/etc/influxdb
# - ./server/influxdb/data:/var/lib/influxdb/data
# - ./server/influxdb/meta:/var/lib/influxdb/meta
# - ./server/influxdb/wal:/var/lib/influxdb/wal
# ports:
# - "8083:8083"
# - "8086:8086"
# restart: always
#内网穿透frps服务端
server:
image: snowdreamtech/frps #xddxdd/frps
container_name: frps
network_mode: host
restart: always
volumes:
- ./server/frp/frps.ini:/etc/frp/frps.ini
#内网穿透frpc客户端
# client:
# image: snowdreamtech/frpc
# container_name: frpc
# network_mode: host
# restart: always
# volumes:
# - ./server/frp/frpc.ini:/etc/frp/frpc.ini
emqx:
image: "emqx/emqx:4.2.3"
container_name: "emqx-4.2.3"
restart: always
environment:
- EMQX_DASHBOARD__DEFAULT_USER__LOGIN=root
- EMQX_DASHBOARD__DEFAULT_USER__PASSWORD=dxlani001
- EMQX_NODE__MAX_PORTS=65535
- EMQX_MQTT__MAX_PACKET_SIZE=16MB
- EMQX_LISTENER__TCP__EXTERNAL=1883
ports:
- "1883:1883"
- "8083:8083"
- "8883:8883"
- "8084:8084"
- "18083:18083"
# elasticsearch:
# restart: always
# image: bolingcavalry/elasticsearch-with-ik:6.5.0
# container_name: elasticsearch
# environment:
# - cluster.name=docker-cluster
# - bootstrap.memory_lock=true
# - http.cors.enabled=true
# - http.cors.allow-origin=*
# - "ES_JAVA_OPTS=-Xms256m -Xmx256m"
# ulimits:
# memlock:
# soft: -1
# hard: -1
# volumes:
# - ./server/es/data:/usr/share/elasticsearch/data
# - /etc/localtime:/etc/localtime
# ports:
# - 9200:9200
# - 9300:9300
# environment:
# TZ: Asia/Shanghai
# kibana:
# restart: always
# image: docker.elastic.co/kibana/kibana:6.5.0
# container_name: kibana
# environment:
# - i18n.locale=zh-CN
# hostname: kibana
# depends_on:
# - elasticsearch
# environment:
# TZ: Asia/Shanghai
# ports:
# - 5601:5601
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Docker
1
https://gitee.com/dingxiaolin/db-deployment.git
git@gitee.com:dingxiaolin/db-deployment.git
dingxiaolin
db-deployment
多数据库一键部署
master

搜索帮助