1.redis,如截图:
#-v后面的添加到卷docker run -itd --name xdclass-redis -p 8000:6379 redis --requirepass 123456 -v /data/redis/data:/data
2.rabbitmq,如截图
#-v后面的加到卷里面, -e 后面的添加到环境变量docker run -d --hostname rabbit_host1 --name rabbitmq1 -p 15672:15672 -p 5672:5672 -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=xdclass.net168 --privileged=true -v /usr/local/rabbitmq/1/lib:/var/lib/rabbitmq -v /usr/local/rabbitmq/1/log:/var/log/rabbitmq rabbitmq:management
3.mysql
docker run -p 3306:3306 --name xdclass_mysql -v /usr/local/docker/mysql/conf:/etc/mysql -v /usr/local/docker/mysql/logs:/var/log/mysql -v /usr/local/docker/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=xdclass.net168 -d mysql:5.7
4.nacos
docker run -d -e MODE=standalone -e SPRING_DATASOURCE_PLATFORM=mysql -e MYSQL_SERVICE_HOST=192.168.0.104 -e MYSQL_SERVICE_PORT=3306 -e MYSQL_SERVICE_USER=root -e MYSQL_SERVICE_PASSWORD=xdclass.net168 -e MYSQL_SERVICE_DB_NAME=xdclass_nacos -p 8848:8848 --restart=always --name nacos nacos/nacos-server:latest
5.nginx
docker run --name shop-nginx -d -p 80:80 -v /usr/local/nginx/conf/nginx.conf:/etc/nginx/nginx.conf nginx
nginx 配置 gateway 负载均衡 ( 内⽹ ip)upstream gateway { server 172.18.119.139:8889; server 172.18.119.139:8888;}server { listen 80; server_name james321.top; location / { proxy_pass http://gateway/; }}