vitess.io/vitess@v0.16.2/examples/compose/vtcompose/docker-compose.test.yml (about) 1 # This file was generated by running `go run vtcompose/vtcompose.go` with no arguments. 2 3 services: 4 consul1: 5 command: agent -server -bootstrap-expect 3 -ui -disable-host-node-id -client 0.0.0.0 6 hostname: consul1 7 image: consul:latest 8 ports: 9 - 8400:8400 10 - 8500:8500 11 - 8600:8600 12 consul2: 13 command: agent -server -retry-join consul1 -disable-host-node-id 14 depends_on: 15 - consul1 16 expose: 17 - "8400" 18 - "8500" 19 - "8600" 20 hostname: consul2 21 image: consul:latest 22 consul3: 23 command: agent -server -retry-join consul1 -disable-host-node-id 24 depends_on: 25 - consul1 26 expose: 27 - "8400" 28 - "8500" 29 - "8600" 30 hostname: consul3 31 image: consul:latest 32 external_db_host: 33 build: 34 context: ./external_db/mysql 35 dockerfile: Dockerfile 36 command: 37 - --server-id=1 38 - --log-bin=mysql-bin 39 - --gtid_mode=ON 40 - --enforce_gtid_consistency 41 - --general_log=1 42 - --slow_query_log=1 43 environment: 44 MYSQL_DATABASE: ${DB:-commerce} 45 MYSQL_PASSWORD: ${DB_PASS:-external_db_password} 46 MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-pass} 47 MYSQL_USER: ${DB_USER:-external_db_user} 48 healthcheck: 49 retries: 10 50 test: /usr/bin/mysql --user=root --password=$${MYSQL_ROOT_PASSWORD} --execute 51 "SHOW DATABASES;" 52 timeout: 10s 53 ports: 54 - "3306" 55 restart: always 56 volumes: 57 - ./external_db/mysql/:/docker-entrypoint-initdb.d/ 58 - ./external_db/mysql/log:/var/log/mysql 59 schemaload_test_keyspace: 60 command: 61 - sh 62 - -c 63 - /script/schemaload.sh 64 depends_on: 65 vttablet101: 66 condition: service_healthy 67 vttablet201: 68 condition: service_healthy 69 environment: 70 - TOPOLOGY_FLAGS=--topo_implementation consul --topo_global_server_address consul1:8500 71 --topo_global_root vitess/global 72 - WEB_PORT=8080 73 - GRPC_PORT=15999 74 - CELL=test 75 - KEYSPACE=test_keyspace 76 - TARGETTAB=test-0000000101 77 - SLEEPTIME=15 78 - VSCHEMA_FILE=test_keyspace_vschema.json 79 - SCHEMA_FILES=test_keyspace_schema_file.sql 80 - POST_LOAD_FILE= 81 - EXTERNAL_DB=0 82 image: vitess/lite:v16.0.2 83 volumes: 84 - .:/script 85 schemaload_unsharded_keyspace: 86 command: 87 - sh 88 - -c 89 - /script/schemaload.sh 90 depends_on: 91 vttablet301: 92 condition: service_healthy 93 environment: 94 - TOPOLOGY_FLAGS=--topo_implementation consul --topo_global_server_address consul1:8500 95 --topo_global_root vitess/global 96 - WEB_PORT=8080 97 - GRPC_PORT=15999 98 - CELL=test 99 - KEYSPACE=unsharded_keyspace 100 - TARGETTAB=test-0000000301 101 - SLEEPTIME=15 102 - VSCHEMA_FILE=unsharded_keyspace_vschema.json 103 - SCHEMA_FILES=unsharded_keyspace_schema_file.sql 104 - POST_LOAD_FILE= 105 - EXTERNAL_DB=0 106 image: vitess/lite:v16.0.2 107 volumes: 108 - .:/script 109 set_keyspace_durability_policy_test_keyspace: 110 command: 111 - sh 112 - -c 113 - /script/set_keyspace_durability_policy.sh 114 depends_on: 115 - vttablet101 116 - vttablet201 117 environment: 118 - GRPC_PORT=15999 119 - KEYSPACES=test_keyspace 120 image: vitess/lite:v16.0.2 121 volumes: 122 - .:/script 123 set_keyspace_durability_policy_unsharded_keyspace: 124 command: 125 - sh 126 - -c 127 - /script/set_keyspace_durability_policy.sh 128 depends_on: 129 - vttablet301 130 environment: 131 - GRPC_PORT=15999 132 - KEYSPACES=unsharded_keyspace 133 image: vitess/lite:v16.0.2 134 volumes: 135 - .:/script 136 vreplication: 137 command: 138 - sh 139 - -c 140 - '[ $$EXTERNAL_DB -eq 1 ] && /script/externaldb_vreplication.sh || exit 0' 141 depends_on: 142 - vtctld 143 environment: 144 - TOPOLOGY_FLAGS=--topo_implementation consul --topo_global_server_address consul1:8500 145 --topo_global_root vitess/global 146 - EXTERNAL_DB=0 147 image: vitess/lite:v16.0.2 148 volumes: 149 - .:/script 150 vtctld: 151 command: 152 - sh 153 - -c 154 - ' /vt/bin/vtctld --topo_implementation consul --topo_global_server_address consul1:8500 155 --topo_global_root vitess/global --cell test 156 --service_map ''grpc-vtctl,grpc-vtctld'' --backup_storage_implementation file 157 --file_backup_storage_root /vt/vtdataroot/backups --logtostderr=true --port 158 8080 --grpc_port 15999 ' 159 depends_on: 160 external_db_host: 161 condition: service_healthy 162 image: vitess/lite:v16.0.2 163 ports: 164 - 15000:8080 165 - "15999" 166 volumes: 167 - .:/script 168 vtgate: 169 command: 170 - sh 171 - -c 172 - '/script/run-forever.sh /vt/bin/vtgate --topo_implementation consul --topo_global_server_address 173 consul1:8500 --topo_global_root vitess/global --logtostderr=true --port 8080 174 --grpc_port 15999 --mysql_server_port 15306 --mysql_auth_server_impl none --cell 175 test --cells_to_watch test --tablet_types_to_wait PRIMARY,REPLICA,RDONLY --service_map 176 ''grpc-vtgateservice'' --normalize_queries=true ' 177 depends_on: 178 - vtctld 179 image: vitess/lite:v16.0.2 180 ports: 181 - 15099:8080 182 - "15999" 183 - 15306:15306 184 volumes: 185 - .:/script 186 vtorc: 187 command: 188 - sh 189 - -c 190 - /script/vtorc-up.sh 191 depends_on: 192 - set_keyspace_durability_policy_unsharded_keyspace 193 - set_keyspace_durability_policy_test_keyspace 194 - vtctld 195 environment: 196 - WEB_PORT=8080 197 - TOPOLOGY_FLAGS=--topo_implementation consul --topo_global_server_address consul1:8500 198 --topo_global_root vitess/global 199 - EXTERNAL_DB=0 200 - DB_USER= 201 - DB_PASS= 202 image: vitess/lite:v16.0.2 203 ports: 204 - 13000:8080 205 volumes: 206 - .:/script 207 vttablet101: 208 command: 209 - sh 210 - -c 211 - /script/vttablet-up.sh 101 212 depends_on: 213 - vtctld 214 environment: 215 - TOPOLOGY_FLAGS=--topo_implementation consul --topo_global_server_address consul1:8500 216 --topo_global_root vitess/global 217 - WEB_PORT=8080 218 - GRPC_PORT=15999 219 - CELL=test 220 - KEYSPACE=test_keyspace 221 - SHARD=-80 222 - ROLE=primary 223 - VTHOST=vttablet101 224 - EXTERNAL_DB=0 225 - DB_PORT= 226 - DB_HOST= 227 - DB_USER= 228 - DB_PASS= 229 - DB_CHARSET= 230 healthcheck: 231 interval: 30s 232 retries: 15 233 test: 234 - CMD-SHELL 235 - curl -s --fail --show-error localhost:8080/debug/health 236 timeout: 10s 237 image: vitess/lite:v16.0.2 238 ports: 239 - 15101:8080 240 - "15999" 241 - "3306" 242 volumes: 243 - .:/script 244 vttablet102: 245 command: 246 - sh 247 - -c 248 - /script/vttablet-up.sh 102 249 depends_on: 250 - vtctld 251 environment: 252 - TOPOLOGY_FLAGS=--topo_implementation consul --topo_global_server_address consul1:8500 253 --topo_global_root vitess/global 254 - WEB_PORT=8080 255 - GRPC_PORT=15999 256 - CELL=test 257 - KEYSPACE=test_keyspace 258 - SHARD=-80 259 - ROLE=replica 260 - VTHOST=vttablet102 261 - EXTERNAL_DB=0 262 - DB_PORT= 263 - DB_HOST= 264 - DB_USER= 265 - DB_PASS= 266 - DB_CHARSET= 267 healthcheck: 268 interval: 30s 269 retries: 15 270 test: 271 - CMD-SHELL 272 - curl -s --fail --show-error localhost:8080/debug/health 273 timeout: 10s 274 image: vitess/lite:v16.0.2 275 ports: 276 - 15102:8080 277 - "15999" 278 - "3306" 279 volumes: 280 - .:/script 281 vttablet201: 282 command: 283 - sh 284 - -c 285 - /script/vttablet-up.sh 201 286 depends_on: 287 - vtctld 288 environment: 289 - TOPOLOGY_FLAGS=--topo_implementation consul --topo_global_server_address consul1:8500 290 --topo_global_root vitess/global 291 - WEB_PORT=8080 292 - GRPC_PORT=15999 293 - CELL=test 294 - KEYSPACE=test_keyspace 295 - SHARD=80- 296 - ROLE=primary 297 - VTHOST=vttablet201 298 - EXTERNAL_DB=0 299 - DB_PORT= 300 - DB_HOST= 301 - DB_USER= 302 - DB_PASS= 303 - DB_CHARSET= 304 healthcheck: 305 interval: 30s 306 retries: 15 307 test: 308 - CMD-SHELL 309 - curl -s --fail --show-error localhost:8080/debug/health 310 timeout: 10s 311 image: vitess/lite:v16.0.2 312 ports: 313 - 15201:8080 314 - "15999" 315 - "3306" 316 volumes: 317 - .:/script 318 vttablet202: 319 command: 320 - sh 321 - -c 322 - /script/vttablet-up.sh 202 323 depends_on: 324 - vtctld 325 environment: 326 - TOPOLOGY_FLAGS=--topo_implementation consul --topo_global_server_address consul1:8500 327 --topo_global_root vitess/global 328 - WEB_PORT=8080 329 - GRPC_PORT=15999 330 - CELL=test 331 - KEYSPACE=test_keyspace 332 - SHARD=80- 333 - ROLE=replica 334 - VTHOST=vttablet202 335 - EXTERNAL_DB=0 336 - DB_PORT= 337 - DB_HOST= 338 - DB_USER= 339 - DB_PASS= 340 - DB_CHARSET= 341 healthcheck: 342 interval: 30s 343 retries: 15 344 test: 345 - CMD-SHELL 346 - curl -s --fail --show-error localhost:8080/debug/health 347 timeout: 10s 348 image: vitess/lite:v16.0.2 349 ports: 350 - 15202:8080 351 - "15999" 352 - "3306" 353 volumes: 354 - .:/script 355 vttablet301: 356 command: 357 - sh 358 - -c 359 - /script/vttablet-up.sh 301 360 depends_on: 361 - vtctld 362 environment: 363 - TOPOLOGY_FLAGS=--topo_implementation consul --topo_global_server_address consul1:8500 364 --topo_global_root vitess/global 365 - WEB_PORT=8080 366 - GRPC_PORT=15999 367 - CELL=test 368 - KEYSPACE=unsharded_keyspace 369 - SHARD=- 370 - ROLE=primary 371 - VTHOST=vttablet301 372 - EXTERNAL_DB=0 373 - DB_PORT= 374 - DB_HOST= 375 - DB_USER= 376 - DB_PASS= 377 - DB_CHARSET= 378 healthcheck: 379 interval: 30s 380 retries: 15 381 test: 382 - CMD-SHELL 383 - curl -s --fail --show-error localhost:8080/debug/health 384 timeout: 10s 385 image: vitess/lite:v16.0.2 386 ports: 387 - 15301:8080 388 - "15999" 389 - "3306" 390 volumes: 391 - .:/script 392 version: "2.1"