feat: add more services

This commit is contained in:
Sun-ZhenXing
2025-10-02 17:46:58 +08:00
parent 30014852ca
commit f330e00fa0
24 changed files with 1489 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
x-default: &default
restart: unless-stopped
volumes:
- &localtime /etc/localtime:/etc/localtime:ro
- &timezone /etc/timezone:/etc/timezone:ro
logging:
driver: json-file
options:
max-size: 100m
services:
consul:
<<: *default
image: consul:${CONSUL_VERSION:-1.20.3}
container_name: consul
ports:
- "${CONSUL_HTTP_PORT_OVERRIDE:-8500}:8500"
- "${CONSUL_DNS_PORT_OVERRIDE:-8600}:8600/udp"
- "${CONSUL_SERF_LAN_PORT_OVERRIDE:-8301}:8301"
- "${CONSUL_SERF_WAN_PORT_OVERRIDE:-8302}:8302"
- "${CONSUL_SERVER_RPC_PORT_OVERRIDE:-8300}:8300"
volumes:
- *localtime
- *timezone
- consul_data:/consul/data
- consul_config:/consul/config
# Custom configuration
# - ./consul.json:/consul/config/consul.json:ro
environment:
- CONSUL_BIND_INTERFACE=${CONSUL_BIND_INTERFACE:-eth0}
- CONSUL_CLIENT_INTERFACE=${CONSUL_CLIENT_INTERFACE:-eth0}
- CONSUL_LOCAL_CONFIG=${CONSUL_LOCAL_CONFIG:-'{"datacenter":"dc1","server":true,"ui_config":{"enabled":true},"bootstrap_expect":1,"log_level":"INFO"}'}
command:
- consul
- agent
- -server
- -bootstrap-expect=1
- -ui
- -client=0.0.0.0
- -bind={{ GetInterfaceIP "eth0" }}
deploy:
resources:
limits:
cpus: '1.00'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
healthcheck:
test: ["CMD-SHELL", "consul members"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
volumes:
consul_data:
consul_config: