Bootstrap

docker-compose部署nacos单机版


  1. docker-compose.yml文件内容如下
version: "3"

services:
  nacos:
    image: dhub.kubesre.xyz/nacos/nacos-server:latest
    container_name: nacos
    privileged: true
    restart: always
    ports:
      - 8848:8848
      - 9848:9848
      - 9849:9849
    environment:
      - JVM_XMS=256m
      - JVM_XMX=256m
      - MODE=standalone
      - PREFER_HOST_MODE=hostname
      - SPRING_DATASOURCE_PLATFORM=mysql
      - MYSQL_SERVICE_HOST=10.60.17.27
      - MYSQL_SERVICE_PORT=13306
      - MYSQL_SERVICE_DB_NAME=nacos_config
      - MYSQL_SERVICE_USER=root
      - MYSQL_SERVICE_PASSWORD=mrms123
      - NACOS_CORE_AUTH_ENABLED=true #开启认证
      - NACOS_CORE_AUTH_SERVER_IDENTITY_KEY=nacos #账号
      - NACOS_CORE_AUTH_SERVER_IDENTITY_VALUE=mrms123 #这个是密钥 不是密码
      - NACOS_CORE_AUTH_PLUGIN_NACOS_TOKEN_SECRET_KEY=ofYd10s0dvDJ8/kK5Y8gdw4dQU6vLy2H+d7Sp4gOQhM=
    volumes:
      - /root/apply/docker/apply/nacos/logs:/home/nacos/logs
      - /root/apply/docker/apply/nacos/init.d/custom.properties:/etc/nacos/init.d/custom.properties
      - /root/apply/docker/apply/nacos/data:/home/nacos/data

  1. 执行docker-compose up -d 命令
docker-compose up -d

访问 ip:8848
在这里插入图片描述

;