windows11 docker 安装mysql、redis、rabbitmq、nginx

mysql

docker run -d --privileged=true --restart=always --name mysql -v /d/Docker/MySQL/data:/var/lib/mysql  -v /d/Docker/MySQL/log:/var/log/mysql -p 3306:3306 -e TZ=Asia/Shanghai -e MYSQL_ROOT_PASSWORD=123456 mysql --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci

redis

docker run -d --privileged=true --restart always --name redis -p 6379:6379 -v /d/Docker/Redis/data:/data redis --requirepass 123456 --appendonly yes

rabbitmq

docker run -d --privileged=true --restart=always --name rabbitmq -p 5672:5672 -p 15672:15672 -e RABBITMQ_DEFAULT_USER=root -e RABBITMQ_DEFAULT_PASS=123456 -v /d/Docker/Rabbitmq/data:/var/lib/rabbitmq  -v /d/Docker/Rabbitmq/log/:/var/log/rabbitmq/log/ rabbitmq:management

nginx

1. 要提前将配置文件准备好,可以先创建一个nginx容器,用docker cp将配置文件拷贝出来

2. nginx容器内访问宿主机服务,可以用 host.docker.internal ,因为IP是会不断变化的

docker run -d --privileged=true --restart=always -p 80:80 -p 443:443 --name nginx -v /d/Docker/Nginx/html/:/usr/share/nginx/html -v /d/Docker/Nginx/conf/nginx.conf:/etc/nginx/nginx.conf -v /d/Docker/Nginx/log/:/var/log/nginx -v /d/Docker/Nginx/conf/conf.d/:/etc/nginx/conf.d nginx

你可能感兴趣的:(Docker,rabbitmq,docker,mysql)