-
Notifications
You must be signed in to change notification settings - Fork 45
/
docker-compose.yaml
198 lines (197 loc) · 8.05 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
version: "3.0"
services:
# This service definition deploys an instance of the relay server
# image configured to work with the dummy driver.
#
relay-server:
image: ${DOCKER_IMAGE_NAME}:${DOCKER_TAG}
container_name: ${RELAY_NAME}
environment:
# General Configuration
# --------------------
#
# Script debugging: by default the debugging feature is turned
# off. You may want to uncomment this variable definition to
# turn the debugging capability of the startup script on. This
# will allow you to log the generation of the configuration
# and the final content of the relay configuration.
#
- DEBUG=true
# Default Relay Server Configuration
# -----------------------------------------------------------
# These settings support the default setup of the relay which
# uses the default configuration template:
#
# ./docker/server.template.toml
#
# This template externalises most of the common information
# that is of use in a standard configurartion with references
# to environment variable in the form ${VAR_NAME}. This allows
# for quickly deploying a relay server with the minimum amount
# of information required.
#
# NOTE: the template is only used if an actual configuration
# specified through the RELAY_CONFIG file is not provided.
# By default this variable points to the configuration:
#
# /opt/relay/config/server.toml
#
# The standard image does not have this file and users
# of the relay image may decide to supply their own
# configuration, which will then override the default
# behaviour of using the template.
#
# Server configuration: this section provides the details for
# specialising the server configuration. These variables are
# only in effect if we do use the standard template for the
# server configuration, since the corresponding values will
# be injected in the configuration template to specialise it
# and generate the actual configuration.
#
- RELAY_PORT=${RELAY_PORT}
- RELAY_NAME=${RELAY_NAME}
# - RELAY_TLS=${RELAY_TLS}
# - RELAY_TLS_CERT_PATH=${RELAY_TLS_CERT_PATH}
# - RELAY_TLS_KEY_PATH=${RELAY_TLS_KEY_PATH}
# Driver configuration: this section provides the details of the
# driver the relay is connected to. We need to supply the port,
# hostname, and name of the driver. The current configuration
# shows the details for a Dummy Driver setup and is only relevant
# if we are using the default configuration template, which is
# referencing these variables.
#
# - DRIVER_NAME=${DRIVER_NAME}
# - DRIVER_PORT=${DRIVER_PORT}
# - DRIVER_HOST=${DRIVER_HOST}
# - DRIVER_TLS=${DRIVER_TLS}
# - DRIVER_TLSCA_CERT_PATH=${DRIVER_TLSCA_CERT_PATH}
# Network configuration: this section provides the information
# associated to the network. This value is only relevant if we
# use the default configuration template which references this
# variable.
#
# - NETWORK_NAME=${NETWORK_NAME}
# - NETWORK_TYPE=${NETWORK_TYPE}
# Uncomment these variables to specify the setup of the relay.
# The values that are assigned to the variables represent the
# default values that are used in the absence of their
# declaration
#
- RELAY_CONFIG=/opt/relay/config/server.toml
# - RELAY_CONFIG=${RELAY_CONFIG}
# - RELAY_CONFIG_TEMPLATE=/opt/relay/config/server.template.toml
# - RELAY_DNS_CONFIG=/opt/relay/config/relays
# You don't need any volumes, these can be uncommented in case
# you are doing debugging of the scripts that initialise the
# the container and you want to check that the everything is
# working ok, or if you want to add additional assets such as
# custom configurations and additional remote relay definitions
#
# - DB_OPEN_MAX_RETRIES=${DB_OPEN_MAX_RETRIES}
# max retries opening sled db if it is locked
# - DB_OPEN_RETRY_BACKOFF_MSEC=${DB_OPEN_RETRY_BACKOFF_MSEC}
# retries back off time for opening sled db if it is locked
#
volumes:
#
# Uncomment these two files if you want to mount your specialised
# scripts for initialisation. Init for the functions and the other
# one for the startup procedure.
#
# - ./docker/init.sh:/opt/relay/init.sh
# - ./docker/entrypoint-server.sh:/opt/relay/entrypoint-server.sh
#
# Uncomment the following volume mounts if you want to customise
# any of the default configurations.
#
# - ./config/Network1.toml:/opt/relay/config/Network1.toml
- ${PATH_TO_CONFIG}:/opt/relay/config/server.toml
# - ${PATH_TO_REMOTE_RELAYS_DEFINITIONS}:/opt/relay/config/relays
# - <path/to/custom-configuration-template>:/opt/relay/config/server.template.toml
- ./credentials/docker:/opt/relay/credentials/docker
# Uncomment this to expose ports internally and externally from the container
ports:
- "${RELAY_PORT}:${RELAY_PORT}"
networks:
- base-network
- relay
relay-driver:
image: dlt-interop/relay-driver:latest
environment:
# General Configuration
# --------------------
#
# Script debugging: by default the debugging feature is turned
# off. You may want to uncomment this variable definition to
# turn the debugging capability of the startup script on. This
# will allow you to log the generation of the configuration
# and the final content of the relay configuration.
#
- DEBUG=true
# Default Dummy Driver Configuration
# ----------------------------------
# These settings contain the information about the configuration
# of the driver. These settings have only effect if there is no
# actual configuration supplied in the path pointed by:
#
# DRIVER_CONFIG=/opt/relay/config/driver.toml
#
# In its absence, the default configuration template that is specified
# via the default configuration template, which references those
# variables, specified by:
#
# DRIVER_CONFIG_TEMPLATE=/opt/relay/config/driver.template.toml
#
# This template references the following variables.
# Driver configuration: these are basic details about the driver such
# as hostname, port, and name.
#
- DRIVER_NAME=Dummy # this is currently not in used at is hard-coded
- DRIVER_PORT=9081
- DRIVER_HOST=relay-driver
# Relay configuration: these are the basic settings about the relay that
# the driver needs to connect to. In particular, we need the hostname,
# the port, and the name.
- RELAY_HOST=relay-server
- RELAY_PORT=9080
- RELAY_NAME=Relay
# Network configuration: these are the basic settings representing the
# the network that is proxied by the driver.
- NETWORK_NAME=dummy
# You don't need to mount any volumes as the environment variables by
# default can automatically generate a configuration that is sufficient
# for the relay driver to. You can mount volume if you want to provide
# customised configuration, a customised template, or customise the
# startup procedure of the dummy driver.
#
# volumes:
#
# Uncomment these two files if you want to mount your specialised
# scripts for initialisation. Init for the functions and the other
# one for the startup procedure.
#
# - ./docker/init.sh:/opt/relay/init.sh
# - ./docker/entrypoint-driver.sh:/opt/relay/entrypoint-driver.sh
#
# Uncomment the following volume mounts if you want to customise
# any of the default configurations.
#
# - <path/to/configuration>:/opt/relay/config/driver.toml
# - <path/to/custom-configuration-template>:/opt/relay/config/driver.template.toml
# Uncomment this to expose ports internally and externally from the container
# ports:
# - "9083:9083"
networks:
- relay
# This networks section is required for when the peers have networks specified
networks:
base-network:
external:
name: ${EXTERNAL_NETWORK}
relay:
external: true