-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
46 lines (44 loc) · 1.42 KB
/
Copy pathdocker-compose.yml
File metadata and controls
46 lines (44 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
services:
# Single node ETCD for testing
etcd:
image: quay.io/coreos/etcd:v3.5.12
container_name: etcd
environment:
- ETCD_NAME=etcd-node
- ETCD_DATA_DIR=/etcd-data
- ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
- ETCD_ADVERTISE_CLIENT_URLS=http://etcd:2379
- ETCD_LISTEN_PEER_URLS=http://0.0.0.0:2380
- ETCD_INITIAL_ADVERTISE_PEER_URLS=http://etcd:2380
- ETCD_INITIAL_CLUSTER=etcd-node=http://etcd:2380
- ETCD_INITIAL_CLUSTER_STATE=new
- ETCD_INITIAL_CLUSTER_TOKEN=etcd-cluster-token
ports:
- "2379:2379"
- "2380:2380"
volumes:
- etcd-data:/etcd-data
healthcheck:
test: ["CMD", "etcdctl", "endpoint", "health"]
interval: 10s
timeout: 5s
retries: 3
# ETCD JSON Converter tool
etcd-json-converter:
image: forcemeter/etcd-json-converter
build:
context: .
dockerfile: Dockerfile
container_name: etcd-json-converter
depends_on:
etcd:
condition: service_healthy
volumes:
- ./data:/data
# Override command as needed, examples:
# Export: docker compose run etcd-json-converter export -e=etcd:2379 -f=/data/export.json
# Import: docker compose run etcd-json-converter import -e=etcd:2379 -f=/data/impoort.json
# Status: docker compose run etcd-json-converter status -e=etcd:2379
command: ["import", "-e=etcd:2379", "-f=/data/backup.json"]
volumes:
etcd-data: