-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.example.yml
More file actions
61 lines (58 loc) · 2.57 KB
/
Copy pathdocker-compose.example.yml
File metadata and controls
61 lines (58 loc) · 2.57 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Run two Stitch bots side by side, each with its own config and wallet key.
#
# One container = one bot = one signer = one corridor. To add more, copy a
# service block, point it at another bots/<name> directory, and give it a
# unique container_name.
#
# One directory per bot, not one shared folder of stitch.<name>.toml files:
# `stitch connect` writes `rfq-api.key` next to the config it was given, so two
# bots sharing a directory would overwrite each other's maker credential.
#
# Copy this file to docker-compose.yml (or run it directly with
# `docker compose -f docker-compose.example.yml ...`) and adjust the paths.
#
# Prereqs (see docs/install-docker.md):
# - bots/bot1/stitch.toml, bots/bot2/stitch.toml copy from stitch.example.toml
# - bots/bot1/stitch.key, bots/bot2/stitch.key one wallet per bot, chmod 600
# - the container runs as uid 1000 and a bind mount keeps host ownership:
# sudo chown -R 1000 ./bots # Linux only; Docker Desktop maps this for you
#
# Connect each bot to Textile before its first start. New bots quote Swap over
# RFQ and rest no public ladder, so without a maker credential a container
# starts and serves nothing. This writes bots/<name>/rfq-api.key, which the bot
# picks up from beside its config on every later run:
# docker compose -f docker-compose.example.yml run --rm bot1 \
# stitch connect --config /home/stitch/run/stitch.toml
#
# Approve Permit2 once per bot before the first live start:
# docker compose -f docker-compose.example.yml run --rm bot1 \
# stitch approve --config /home/stitch/run/stitch.toml
#
# Dry run to validate, then go live:
# docker compose -f docker-compose.example.yml run --rm bot1 \
# stitch --config /home/stitch/run/stitch.toml --dry-run
# docker compose -f docker-compose.example.yml up -d
x-stitch: &stitch
image: ghcr.io/textile-protocol/textile-stitch:latest
# Or build from source in this directory instead of pulling the image:
# build: .
restart: unless-stopped
# SIGTERM (docker stop / compose down) shuts down cleanly after the current
# tick. Give it room to finish before the kill.
stop_grace_period: 30s
environment:
RUST_LOG: info
STITCH_PRIVATE_KEY_FILE: /home/stitch/run/stitch.key
services:
bot1:
<<: *stitch
container_name: stitch-bot1
volumes:
# The whole bot directory, writable: `stitch connect` rewrites stitch.toml
# and drops rfq-api.key beside it, and both have to survive the container.
- ./bots/bot1:/home/stitch/run
bot2:
<<: *stitch
container_name: stitch-bot2
volumes:
- ./bots/bot2:/home/stitch/run