feat(database): unify recipe host ports and add Consul, Elasticsearch

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-08-10 18:27:20 +08:00
1 parent deba5db2fd
commit f5e7a37c8d
49 files changed
+522 -135

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
services:
database:
image: docker.cnb.cool/znb/images/consul:2.0.2
container_name: dbx-consul-2.0.2
restart: unless-stopped
command:
- agent
- -dev
- -client=0.0.0.0
- -ui
- -data-dir=/consul/data
ports:
- "${DB_BIND_ADDRESS:-127.0.0.1}:${DB_PORT:-10900}:8500"
- "${DB_BIND_ADDRESS:-127.0.0.1}:${CONSUL_GRPC_PORT:-10901}:8502"
- "${DB_BIND_ADDRESS:-127.0.0.1}:${CONSUL_DNS_PORT:-10902}:8600/tcp"
- "${DB_BIND_ADDRESS:-127.0.0.1}:${CONSUL_DNS_PORT:-10902}:8600/udp"
volumes:
- data:/consul/data
healthcheck:
test: ["CMD", "consul", "members", "-http-addr=http://127.0.0.1:8500"]
interval: 5s
timeout: 5s
retries: 30
start_period: 10s
volumes:
data:
@@ -0,0 +1,3 @@
# Consul development data
The Consul development agent starts without ACL authentication. `make db-verify DB=consul@2.0.2` writes and reads the `dbx/smoke` KV value.
+14
View File
@@ -0,0 +1,14 @@
{
"database": "consul",
"name": "Consul",
"version": "2.0.2",
"displayVersion": "2.0.2",
"image": "docker.cnb.cool/znb/images/consul:2.0.2",
"platforms": ["linux/amd64", "linux/arm64"],
"service": "database",
"defaultPort": 8500,
"connection": { "host": "127.0.0.1", "port": 10900, "authentication": "none", "database": "dbx", "grpcPort": 10901, "dnsPort": 10902 },
"hostPorts": { "DB_PORT": 10900, "CONSUL_GRPC_PORT": 10901, "CONSUL_DNS_PORT": 10902 },
"shell": ["consul", "members", "-http-addr=http://127.0.0.1:8500"],
"smoke": { "steps": [{ "name": "write a Consul KV smoke value", "command": ["consul", "kv", "put", "-http-addr=http://127.0.0.1:8500", "dbx/smoke", "DBX smoke"], "expect": "Success! Data written" }, { "name": "read the Consul KV smoke value", "command": ["consul", "kv", "get", "-http-addr=http://127.0.0.1:8500", "dbx/smoke"], "expect": "DBX smoke" }] }
}