docker安装nacos并配置数据库
搜索nacos相关的包
docker search nacos
选择最多的
然后执行下载命令
docker pull nacos/nacos-server
启动命令
docker run --name nacos --env MODE=standalon -d -p 8848:8848 nacos/nacos-server
查看容器ID并进入容器内部
`docker exec -it [容器ID|容器名称] /bin/bash
创建容器外部的目录(挂载目录)
mkdir -p /home/nacos
使用docker cp将内部application.properties复制到/home/nacos/下
docker cp [容器ID]:/home/nacos/conf/application.properties /home/nacos/
修改/home/nacos/application.properties中的数据库连接
#
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#*************** Spring Boot Related Configurations ***************#
### Default web context path:
server.servlet.contextPath=/nacos
### Default web server port:
server.port=8848
#*************** Network Related Configurations ***************#
### If prefer hostname over ip for Nacos server addresses in cluster.conf:
# nacos.inetutils.prefer-hostname-over-ip=false
### Specify local server's IP:
# nacos.inetutils.ip-address=
#*************** Config Module Related Configurations ***************#
### If use MySQL as datasource:
spring.datasource.platform=mysql
### Count of DB:
db.num=1
### Connect URL of DB:
db.url.0=jdbc:mysql://IP:3306/nacos_config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user.0=zh
db.password.0=mima
##