Files
rustfs-s3-toolkit/docker/docker-compose.yml
2025-09-28 21:07:29 +08:00

110 lines
2.8 KiB
YAML
Raw 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.9"
services:
rustfs:
image: rustfs/rustfs:1.0.0-alpha.60
container_name: rustfs_container
restart: always
ports:
- "${SERVICE_IP}:${PORT_RUSTFS}:${PORT_RUSTFS}"
volumes:
- /vol2/1000/rustfs_vol2:/data
- ./data:/app/data:rw
environment:
RUSTFS_VOLUMES: /data/rustfs0
RUSTFS_ADDRESS: ":${PORT_RUSTFS}"
RUSTFS_SERVER_DOMAINS: ${DOMAIN_RUSTFS}
RUSTFS_ACCESS_KEY: lingyuzeng
RUSTFS_SECRET_KEY: rust@Hotwa2020
RUSTFS_CONSOLE_ENABLE: "true"
rustfs-s3-toolkit:
image: hotwa/rustfs-s3-toolkit:latest
build:
context: ..
dockerfile: docker/Dockerfile
container_name: rustfs-s3-toolkit
restart: always
volumes:
- ./data:/app/data:rw
ports:
- "${SERVICE_IP}:${PORT_MCP}:${PORT_MCP}"
consul-agent:
image: hashicorp/consul:1.21
stop_signal: SIGTERM
stop_grace_period: 60s
command:
- agent
- -server=false
- -node=${NODE_NAME}
- -client=0.0.0.0
- -bind=0.0.0.0
- -advertise=${SERVICE_IP}
- -retry-join=${CONSUL_SERVER_IP}
- -datacenter=${CONSUL_DC}
- -data-dir=/consul/data
environment:
CONSUL_LOCAL_CONFIG: '{"leave_on_terminate": true}'
ports:
- "${SERVICE_IP}:8500:8500/tcp"
- "${SERVICE_IP}:8600:8600/tcp"
- "${SERVICE_IP}:8600:8600/udp"
- "${SERVICE_IP}:8301:8301/tcp"
- "${SERVICE_IP}:8301:8301/udp"
healthcheck:
test: ["CMD", "consul", "info"]
interval: 5s
timeout: 3s
retries: 30
start_period: 10s
restart: unless-stopped
# 注册 rustfs9000
registrar_rustfs:
image: hashicorp/consul:1.21
depends_on:
consul-agent:
condition: service_healthy
rustfs:
condition: service_started
environment:
CONSUL_HTTP_ADDR: "http://consul-agent:8500"
SERVICE_NAME: "${SVC_RUSTFS}"
SERVICE_ADDR: "${SERVICE_IP}"
SERVICE_PORT: "${PORT_RUSTFS}"
SERVICE_TAGS: "console"
CHECK_TYPE: "tcp"
CHECK_INTERVAL: "10s"
CHECK_TIMEOUT: "2s"
DEREG_AFTER: "1m"
volumes:
- ./registrar.sh:/registrar.sh:ro
entrypoint: ["/bin/sh","-lc","/registrar.sh"]
restart: unless-stopped
# 注册 MCP9009
registrar_mcp:
image: hashicorp/consul:1.21
depends_on:
consul-agent:
condition: service_healthy
rustfs-s3-toolkit:
condition: service_started
environment:
CONSUL_HTTP_ADDR: "http://consul-agent:8500"
SERVICE_NAME: "${SVC_MCP}"
SERVICE_ADDR: "${SERVICE_IP}"
SERVICE_PORT: "${PORT_MCP}"
SERVICE_TAGS: "toolkit"
CHECK_TYPE: "tcp"
CHECK_INTERVAL: "10s"
CHECK_TIMEOUT: "2s"
DEREG_AFTER: "1m"
volumes:
- ./registrar.sh:/registrar.sh:ro
entrypoint: ["/bin/sh","-lc","/registrar.sh"]
restart: unless-stopped
networks: {}