1、Mysql
docker-compose.yml
version: '3'
services:
mysql:
image: mysql:5.7.23
#容器名称
container_name: mysql5.7.23
#network_mode: "host"
#随Docker启动
restart: always
ports:
- "3306:3306"
environment:
#root用户密码
MYSQL_ROOT_PASSWORD: *****
volumes:
#自定配置
- ./conf:/etc/mysql/conf.d
#数据挂载
- ./data:/var/lib/mysql
my.cnf
[mysqld]
# disable_ssl 关闭SSL
skip_ssl
#不启动grant-tables,授权表 修改授权时使用
#skip-grant-tables
#大小写忽略
lower_case_table_names=1
2、Redis
docker-compose.yml
version: '3'
services:
redis:
image: redis:latest
#容器名称
container_name: redis
#network_mode: "host"
#随Docker启动
restart: always
ports:
- "6379:6379"
volumes:
#数据挂载
- ./conf/redis.conf:/usr/local/etc/redis/redis.conf
- ./data:/data
command: redis-server --requirepass sysdba --appendonly yes --notify-keyspace-events Eglx
redis.conf
# bind 127.0.0.1 //加上注释#
port 6379 //绑定自定义端口
protected-mode no //关闭保护模式
#daemonize yes //禁止redis后台运行
#requirepass 123456 // 密码
# 集群相关配置
pidfile /var/run/redis_6061.pid
cluster-enabled yes //开启集群 把注释#去掉
cluster-config-file nodes_6061.conf //集群的配置 配置文件首次启动自动生成
3、Zookeeper
docker-compose.yml
version: '3.1'
services:
zoo1:
image: zookeeper
restart: always
hostname: zoo1
ports:
- 2181:2181
environment:
ZOO_MY_ID: 1
ZOO_SERVERS: server.1=0.0.0.0:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888
zoo2:
image: zookeeper
restart: always
hostname: zoo2
ports:
- 2182:2181
environment:
ZOO_MY_ID: 2
ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=0.0.0.0:2888:3888 server.3=zoo3:2888:3888
zoo3:
image: zookeeper
restart: always
hostname: zoo3
ports:
- 2183:2181
environment:
ZOO_MY_ID: 3
ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=0.0.0.0:2888:3888
4、Tomcat
docker-compose.yml
version: '3'
services:
dubbo:
image: tomcat:latest
ports:
#
- "80:8080"
volumes:
- ./xxxx.war:/usr/local/tomcat/webapps/xxxx.war
// 访问地址
宿主ip/xxxx
5、Jenkins
docker-compose.yml
version: '3'
services:
jenkins:
image: jenkins/jenkins:lts
ports:
- "8080:8080"
- "50000:50000"
volumes:
- ./jenkins_home:/var/jenkins_home
# JDK
- /usr/local/service/jdk1.8.0_181:/usr/local/service/jdk1.8.0_181
# Maven
- /usr/local/service/maven-3.5.4:/usr/local/service/maven-3.5.4
- /usr/local/service/maven-jars:/usr/local/service/maven-jars