add consul test
This commit is contained in:
@@ -1,4 +1,21 @@
|
||||
services:
|
||||
rustfs:
|
||||
image: rustfs/rustfs:1.0.0-alpha.59
|
||||
container_name: rustfs_container
|
||||
restart: always
|
||||
ports:
|
||||
- 100.64.0.5:9000:9000
|
||||
volumes:
|
||||
- /vol2/1000/rustfs_vol2:/data
|
||||
- ./data:/app/data:rw # 新增,共用 ./data
|
||||
environment:
|
||||
RUSTFS_VOLUMES: /data/rustfs0
|
||||
RUSTFS_ADDRESS: :9000
|
||||
RUSTFS_SERVER_DOMAINS: rfs.jmsu.top
|
||||
RUSTFS_ACCESS_KEY: lingyuzeng
|
||||
RUSTFS_SECRET_KEY: rust@Hotwa2020
|
||||
RUSTFS_CONSOLE_ENABLE: "true"
|
||||
|
||||
rustfs-s3-toolkit:
|
||||
image: hotwa/rustfs-s3-toolkit:latest
|
||||
build:
|
||||
@@ -7,6 +24,46 @@ services:
|
||||
container_name: rustfs-s3-toolkit
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
- ./data:/app/data:rw
|
||||
ports:
|
||||
- "8009:9009"
|
||||
- "100.64.0.5:9009:9009"
|
||||
|
||||
consul-agent:
|
||||
image: hashicorp/consul:1.21
|
||||
command: >
|
||||
agent
|
||||
-client=0.0.0.0
|
||||
-bind=100.64.0.5
|
||||
-advertise=100.64.0.5
|
||||
-data-dir=/consul/data
|
||||
-retry-join=100.64.0.1
|
||||
-datacenter=dc1
|
||||
# network_mode: "host" # 避免 8301/udp 等端口映射问题
|
||||
volumes:
|
||||
- /var/lib/consul:/consul/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8500/v1/agent/self >/dev/null"]
|
||||
interval: 3s
|
||||
timeout: 2s
|
||||
retries: 60
|
||||
restart: unless-stopped
|
||||
|
||||
registrar:
|
||||
image: hashicorp/consul:1.21
|
||||
network_mode: "host"
|
||||
depends_on:
|
||||
consul-agent:
|
||||
condition: service_healthy
|
||||
rustfs-s3-toolkit:
|
||||
condition: service_started
|
||||
environment:
|
||||
- SERVICE_NAME=rustfs
|
||||
- SERVICE_ADDR=100.64.0.5
|
||||
- SERVICE_PORT=9000
|
||||
- CONSUL_HTTP_ADDR=http://127.0.0.1:8500
|
||||
volumes:
|
||||
- ./registrar.sh:/registrar.sh:ro
|
||||
entrypoint: ["/bin/sh","-lc","/registrar.sh"]
|
||||
restart: unless-stopped
|
||||
|
||||
networks: {}
|
||||
Reference in New Issue
Block a user