Docker 上部署Mysql8.x、Nacos2.x、Redis7.x、Minio、Kafka-Kraft
以下是一个简化版的Docker Compose文件示例,用于部署Mysql 8.x、Nacos 2.x、Redis 7.x、Minio、Kafka-Kraft。
version: '3.8'
services:
mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: mydb
ports:
- "3306:3306"
nacos:
image: nacos/nacos-server:2.0.3
environment:
MODE: standalone
ports:
- "8848:8848"
redis:
image: redis:7.0
ports:
- "6379:6379"
minio:
image: minio/minio:RELEASE.2022-01-12T23-19-39Z
environment:
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
ports:
- "9000:9000"
command: server /data --console-address ":9001"
kafka:
image: confluentinc/cp-kafka:7.0.1
ports:
- "9092:9092"
environment:
KAFKA_PROCESS_ROLES: broker
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
depends_on:
- zookeeper
zookeeper:
image: confluentinc/cp-zookeeper:7.0.1
ports:
- "2181:2181"
networks:
default:
driver: bridge
这个示例定义了一个简单的Docker Compose文件,用于在单个Docker环境中启动多个服务,包括Mysql 8.x、Nacos 2.x、Redis 7.x、Minio以及Kafka-Kraft。每个服务都被分配了合适的环境变量和端口映射,以便于它们可以被外部访问。
请注意,这个示例假设您已经安装了Docker和Docker Compose。您可以通过在终端中运行docker-compose up
命令来启动所有服务。
评论已关闭