-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
74 lines (73 loc) · 3.27 KB
/
docker-compose.yaml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
# Deployment for running a single Concordium Rosetta instance, optionally with an instance of rosetta-cli.
# The deployment supports all the usual env vars of the service.
#
# Most values are passed directly to the service with no default values.
# A few are slightly redefined as follows:
#
# - The value of `CONCORDIUM_ROSETTA_GRPC_HOST` defaults to `172.17.0.1`,
# i.e. a node running on the container's host.
# - The value of `CONCORDIUM_ROSETTA_PORT` only determines the port exposed to the host.
# The internal port is hard-coded to 8080.
# The default value of the exposed port is still 8080.
# Don't change this when running with profile 'check-data' as the Rosetta CLI expects to use this port on the host.
#
# The image containing the application is set using `ROSETTA_IMAGE`.
# If this value isn't provided, it will default to an image that doesn't exist publicly ("concordium-rosetta:test).
# This will cause Compose to build the image from source.
# Note that the image is cached locally so will be used without rebuild in subsequent runs, even if the source code has changed.
# Delete the image or change `ROSETTA_IMAGE` to rebuild.
#
# Finally, `CONCORDIUM_ROSETTA_NETWORK` has no default value so must be set explicitly.
#
# Example:
#
# ROSETTA_IMAGE=concordium/rosetta:1.0.0-0 \
# CONCORDIUM_ROSETTA_GRPC_HOST=node.mainnet.concordium.example.com \
# CONCORDIUM_ROSETTA_NETWORK=mainnet \
# docker compose up -d
#
# For testing the implementation, an extra service `rosetta-cli-check-data` may be included.
# This is a custom fork of the official Rosetta CLI that understands Concordium account aliases (see './tools/rosetta-cli-docker').
# Run the deployment with Compose profile `check-data` to enable this service.
# The baked in configuration of the tool expects the following:
# - Rosetta is exposed on port 8080 on the host network.
# - The network is set to "rosetta".
#
# Example:
# ROSETTA_IMAGE=concordium/rosetta:1.0.0-0 \
# CONCORDIUM_ROSETTA_GRPC_HOST=node.mainnet.concordium.example.com \
# CONCORDIUM_ROSETTA_NETWORK=rosetta \
# docker compose --profile=check-data up -d
version: '3'
services:
rosetta:
container_name: rosetta
build:
context: .
args:
build_image: ${ROSETTA_BUILD_IMAGE-rust:1.73-slim-buster}
base_image: ${ROSETTA_BASE_IMAGE-debian:buster-slim}
image: ${ROSETTA_IMAGE-concordium-rosetta:test}
environment:
- CONCORDIUM_ROSETTA_GRPC_HOST=${CONCORDIUM_ROSETTA_GRPC_HOST-172.17.0.1}
- CONCORDIUM_ROSETTA_GRPC_PORT
- CONCORDIUM_ROSETTA_NETWORK
- CONCORDIUM_ROSETTA_PORT=8080
ports:
- "${CONCORDIUM_ROSETTA_PORT-8080}:8080"
stop_signal: SIGKILL
rosetta-cli-check-data:
profiles: [ check-data ]
container_name: rosetta-cli-check-data
build:
context: ./tools/rosetta-cli-docker
args:
build_image: ${ROSETTA_CLI_BUILD_IMAGE-golang:1.16-buster} # the project lists "go 1.16" in 'go.mod'
base_image: ${ROSETTA_CLI_BASE_IMAGE-debian:buster-slim}
image: ${ROSETTA_CLI_IMAGE-concordium/rosetta-cli:test}
# TODO Consider mounting in config file that uses rosetta directly on the internal network.
# Or maybe generating the file on runtime with some parameterized settings would be better...
depends_on:
- rosetta
command:
- "check:data"