Docker安装Nacos

2023-01-20  本文已影响0人  面向对象架构
version: '3.8'

services:
  nacos:
    container_name: nacos-server-2.1.1
    image: nacos/nacos-server:v2.1.1
    environment:
      - MODE=standalone
      - PREFER_HOST_MODE=hostname
      - TZ=Asia/Shanghai
      - LANG=en_US.UTF-8
      - SPRING_DATASOURCE_PLATFORM=mysql
      - MYSQL_SERVICE_HOST=192.168.1.1
      - MYSQL_SERVICE_DB_NAME=nacos_config
      - MYSQL_SERVICE_PORT=3306
      - MYSQL_SERVICE_USER=username
      - MYSQL_SERVICE_PASSWORD=xxxxx
      - MYSQL_SERVER_DB_PARAM=characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&&connectTimeout=10000&socketTimeout=30000
      - JVM_XMS=256m
      - JVM_XMX=256m

    volumes:
      - ./init.d/custom.properties:/home/nacos/init.d/custom.properties
    networks:
      - default
#    network_mode: host
    privileged: true
    ports:
      - 8848:8848
      - 9848:9848
      - 9849:9849
#    network_mode: host
上一篇下一篇

猜你喜欢

热点阅读