常见的docker部署命令
nacos 部署
docker run --env MODE=standalone --name his-nacos.his --network ruoyi -d -p 8848:8848 -e SPRING_DATASOURCE_PLATFORM=mysql -e MYSQL_SERVICE_HOST=172.31.0.4 -e MYSQL_SERVICE_PORT=3306 -e MYSQL_SERVICE_DB_NAME=ry-config -e MYSQL_SERVICE_USER=root -e MYSQL_SERVICE_PASSWORD=root nacos/nacos-server:v2.0.4
mysql 部署
docker run -p 3306:3306 --name mysql8.0 -v /my/custom:/etc/mysql/conf.d -v /my/own/datadir:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=root -d mysql:8.0.28
redis 部署
docker run -p 6379:6379 -d --restart=always --name redis -v /usr/local/docker/redis.conf:/etc/redis/redis.conf -v /usr/local/dockr/data:/data redis redis-server /etc/redis/redis.conf --appendonly yes
rabbitmq 部署
docker run -d --restart=always --hostname my-rabbit --name rabbit -p 15672:15672 -p 5672:5672 rabbitmq
docker ps
docker exec -it 镜像ID /bin/bash
rabbitmq-plugins enable rabbitmq_management
http://linuxip地址:15672,这里的用户名和密码默认都是guest
mongodb 部署
docker run -d --restart=always -p 27017:27017 --name mongo -v /data/db:/data/db -d mongo:4.4.1
xxl-job部署
docker run -e PARAMS="--spring.datasource.url=jdbc:mysql://rm-bp1lt9pq0b5boa33zno.mysql.rds.aliyuncs.com:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai --spring.datasource.username=*** --spring.datasource.password=***" -p 5601:8080 -v /tmp:/data/applogs --name xxl-job-admin -d xuxueli/xxl-job-admin:2.3.0