Files
sa-charts/docker-swarm/nacos-cluser/standalone-derby.yml
2024-06-05 13:13:44 +08:00

39 lines
1.3 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version: '3.8'
networks:
default:
name: ${NAMESPACE}
external: true
services:
server:
hostname: ${NAMESPACE}_nacos_server
image: nacos/nacos-server:${NACOS_VERSION}
environment:
- PREFER_HOST_MODE=hostname
- NACOS_SERVER_IP=${NACOS_SERVER_IP}
- MODE=standalone
- NACOS_AUTH_ENABLE=true
- NACOS_AUTH_IDENTITY_KEY=bndmsdsad
- NACOS_AUTH_IDENTITY_VALUE=wepqweq#dasld
- NACOS_AUTH_TOKEN=SecretKey012345678901234567890123456587012345678901234567890123456789
ports:
- target: 8848
published: ${NODE_PORT}
protocol: tcp
mode: host # 解析默认是ingress就是通过swarm的负载均衡模式无论通过集群节点的映射端口都能访问到业务容器此种方式类似于k8s的NodePort的svc服务暴露方式而host则属于业务容器运行在哪个节点则就通过节点地址+映射端口访问对应的业务容器。
- target: 9848
published: ${NODE_PORT_2}
protocol: tcp
mode: host
volumes:
- data_server:/home/nacos/
deploy:
update_config:
order: stop-first
placement:
constraints:
- node.labels.${NAMESPACE}_nacos_server==1
volumes:
data_server:
driver: local