fraudbusters-compose/docker-compose.yml
Kostya Struga 30540c44d3 Add tests
2022-05-13 14:33:39 +03:00

404 lines
15 KiB
YAML

---
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:5.0.1
# image: watershine/cp-zookeeper:6.1.0-arm64
hostname: zookeeper
container_name: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
volumes:
- ./tmp/docker/zookeeper/data:/var/lib/zookeeper/data
- ./tmp/docker/zookeeper/logs:/var/lib/zookeeper/log
broker:
image: confluentinc/cp-enterprise-kafka:5.0.1
# image: watershine/cp-enterprise-kafka:6.1.0-arm64
hostname: broker
container_name: broker
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT_HOST://broker:29092,PLAINTEXT://broker:9092
KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: broker:9092
CONFLUENT_METRICS_REPORTER_ZOOKEEPER_CONNECT: zookeeper:2181
CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS: 1
CONFLUENT_METRICS_ENABLE: 'true'
CONFLUENT_SUPPORT_CUSTOMER_ID: 'anonymous'
ports:
- 9092:9092
- 29092:29092
volumes:
- ./tmp/docker/kafka/data:/var/lib/kafka/data
kafka-setup:
image: confluentinc/cp-kafka:5.1.1
hostname: kafka-setup
container_name: kafka-setup
depends_on:
- broker
command: "bash -c 'echo Waiting for Kafka to be ready... && \
cub kafka-ready -b broker:9092 1 60 && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic wb-list-command && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic wb-list-event-sink && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic result && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic fraud_payment && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic payment_event && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic filtered_payment && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic refund_event && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic chargeback_event && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic withdrawal && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic filtered_withdrawal && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic unknown_initiating_entity && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --config cleanup.policy=compact --topic template && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --config cleanup.policy=compact --topic template_reference && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --config cleanup.policy=compact --topic group_list && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --config cleanup.policy=compact --topic group_reference && \
echo Waiting 60 seconds for Connect to be ready... && \
sleep 60'"
riak:
image: basho/riak-kv
hostname: riak
container_name: riak
ports:
- "8087:8087"
- "8098:8098"
environment:
- CLUSTER_NAME=riakts
- WAIT_FOR_ERLANG=500
- TZ=Europe/Moscow
labels:
- "com.basho.riak.cluster.name=riakts"
volumes:
- /tmp/docker/riak/data:/etc/riak/schemas
clickhouse:
image: yandex/clickhouse-server:20.6.7.4
# image: lunalabsltd/clickhouse-server:20.6.7.4-arm
hostname: clickhouse
container_name: clickhouse
environment:
CLICKHOUSE_USER: user
CLICKHOUSE_PASSWORD: password
ports:
- 9000:9000
- 8123:8123
volumes:
- ./clickhouse/data:/var/lib/clickhouse
- ./clickhouse/log:/var/log
- ./clickhouse/docker-entrypoint-initdb.d/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
grafana:
image: grafana/grafana:5.1.0
hostname: grafana
container_name: grafana
ports:
- 3000:3000
environment:
GF_INSTALL_PLUGINS: "grafana-piechart-panel,vertamedia-clickhouse-datasource"
GF_SECURITY_ADMIN_USER: "admin"
GF_SECURITY_ADMIN_PASSWORD: "admin"
volumes:
- ./grafana/dashboards:/etc/grafana/provisioning/dashboards
- ./grafana/datasources:/etc/grafana/provisioning/datasources
columbus:
image: ghcr.io/valitydev/columbus:sha-13b6ac4
hostname: columbus
container_name: columbus
mem_limit: 1024m
mem_reservation: 256M
entrypoint: "java -Xmx1024m -jar /opt/columbus/columbus.jar"
environment:
logging.config: "tmp/logback-test.xml"
ports:
- 8990:8022
volumes:
- ./log-java:/opt/columbus/tmp
wblist:
image: ghcr.io/valitydev/wb-list-manager:sha-a790a3b
hostname: wblist
container_name: wblist
mem_limit: 256m
mem_reservation: 128M
environment:
kafka.bootstrap-servers: "broker:9092"
riak.address: riak
riak.port: 8087
management.metrics.export.statsd.enabled: "false"
logging.level.com.rbkmoney.woody: "ERROR"
kafka.wblist.topic.command: "wb-list-command"
kafka.wblist.topic.event.sink: "wb-list-event-sink"
depends_on:
- riak
- broker
ports:
- 8991:8022
trusted-tokens-manager:
image: ghcr.io/valitydev/trusted-tokens-manager:sha-efd3f86
hostname: trusted-tokens-manager
container_name: trusted-tokens-manager
mem_limit: 256m
mem_reservation: 128M
entrypoint: "java -Xmx256m -jar /opt/trusted-tokens-manager/trusted-tokens-manager.jar"
environment:
kafka.bootstrap-servers: "broker:9092"
kafka.client-id: "trusted-tokens-manager"
kafka.topics.payment.id: "payment_event"
kafka.topics.payment.consume.enabled: "true"
kafka.topics.withdrawal.consume.enabled: "true"
kafka.topics.withdrawal.id: "withdrawal"
kafka.num-stream-threads: 1
riak-config.address: riak
riak-config.port: 8087
management.metrics.export.statsd.enabled: "false"
logging.config: "tmp/logback-test.xml"
depends_on:
- riak
- broker
ports:
- 8992:8022
volumes:
- ./log-java:/opt/trusted-tokens-manager/tmp
fraudbusters-api:
image: ghcr.io/valitydev/fraudbusters-api:sha-41010ca
hostname: fraudbusters-api
container_name: fraudbusters-api
mem_limit: 350m
mem_reservation: 128M
entrypoint: "java -Xmx350m -jar /opt/fraudbusters-api/fraudbusters-api.jar"
environment:
management.security.enabled: 'false'
logging.config: "tmp/logback-test.xml"
fraudbusters.service.payment.url: 'http://fraudbusters:8022/fraud_payment/v1/'
fraudbusters.service.payment.networkTimeout: 30000
fraudbusters.service.inspector.url: 'http://fraudbusters:8022/fraud_inspector/v1'
fraudbusters.service.inspector.networkTimeout: 30000
server.port: "8080"
depends_on:
- fraudbusters
ports:
- 9999:8080
volumes:
- ./log-java:/opt/fraudbusters-api/tmp
fraudbusters:
image: ghcr.io/valitydev/fraudbusters:sha-718957d
hostname: fraudbusters
container_name: fraudbusters
mem_limit: 512m
mem_reservation: 128M
entrypoint: "java -Xmx512m -jar /opt/fraudbusters/fraudbusters.jar"
environment:
management.security.enabled: 'false'
kafka.ssl.enable: 'false'
kafka.bootstrap.servers: "broker:9092"
geo.ip.service.url: "http://columbus:8022/repo"
wb.list.service.url: "http://wblist:8022/wb_list/v1"
clickhouse.db.url: "jdbc:clickhouse://clickhouse:8123/default"
logging.config: "tmp/logback-test.xml"
card-token-pool.filePath: "card-tokens"
clickhouse.db.user: 'user'
clickhouse.db.password: 'password'
fraud.management.url: 'http://fb-management:8080/fb-management/v1'
result.full.check.enabled: 'false'
spring.profiles.active: 'full-prod'
load.isTrusted.enabled: 'false'
trusted.tokens.url: 'http://trusted-tokens-manager:8022/trusted/tokens'
trusted.tokens.timeout: 30000
dgraph.service.enabled: 'false'
kafka.topic.group-list: 'group_list'
kafka.topic.group-reference: 'group_reference'
kafka.listen.result.concurrency: 7
kafka.max.poll.records: 1
kafka.max.backoff.interval: 1000
depends_on:
- clickhouse
- broker
- columbus
- wblist
- kafka-setup
- trusted-tokens-manager
ports:
- 8999:8022
- 8111:8089
volumes:
- ./log-java:/opt/fraudbusters/tmp
- ./card-tokens:/opt/fraudbusters/card-tokens
postgres-fb:
container_name: postgres_container
hostname: postgres-fb
image: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: fraudbusters
PGDATA: /data/postgres
ports:
- 6432:5432
volumes:
- ./postgres/data/3:/data/postgres
restart: unless-stopped
fb-management:
image: ghcr.io/valitydev/fraudbusters-management:sha-cc49e98
hostname: fb-management
container_name: fb-management
mem_limit: 400m
mem_reservation: 128M
entrypoint: "java -Xmx400m -jar /opt/fraudbusters-management/fraudbusters-management.jar"
environment:
kafka.bootstrap-servers: "broker:9092"
kafka.topic.wblist.command: "wb-list-command"
kafka.topic.wblist.event.sink: "wb-list-event-sink"
kafka.topic.fraudbusters.payment.template: "template"
kafka.topic.fraudbusters.payment.reference: "template_reference"
kafka.topic.fraudbusters.payment.group.list: "group_list"
kafka.topic.fraudbusters.payment.group.reference: "group_reference"
spring.datasource.url: "jdbc:postgresql://postgres-fb:5432/fraudbusters"
logging.config: "./tmp/logback-test.xml"
management.metrics.binders.jvm.enabled: 'false'
service.payment.url: 'http://fraudbusters:8022/fraud_payment/v1/'
service.payment.networkTimeout: 60000
service.historical.url: 'http://fraudbusters:8022/historical_data/v1/'
service.historical.networkTimeout: 60000
service.notification.url: 'http://fb-notificator:8022/notification/v1'
service.notification-channel.url: 'http://fb-notificator:8022/notification-channel/v1'
service.notification-template.url: 'http://fb-notificator:8022/notification-template/v1'
spring.profiles.active: 'debug'
keycloak.enabled: "false"
keycloak.realm: "fraudbusters-realm"
keycloak.resource: "fraudbusters-app"
keycloak.auth-server-url: "http://keycloak:8080/auth"
cors.allowed-origins: "*"
ports:
- 8085:8080
depends_on:
- fraudbusters
- broker
- wblist
- postgres-fb
- kafka-setup
- fb-notificator
volumes:
- ./log-java:/opt/fraudbusters-management/tmp
fb-notificator:
image: ghcr.io/valitydev/fraudbusters-notificator:sha-2574ac0
hostname: fb-notificator
container_name: fb-notificator
mem_limit: 256m
mem_reservation: 128M
environment:
spring.datasource.url: "jdbc:postgresql://postgres-notificator:5432/fb_notificator"
logging.config: "./tmp/logback-test.xml"
management.metrics.binders.jvm.enabled: 'false'
warehouse.url: 'http://fb-warehouse:8022/query/v1/'
spring.profiles.active: 'debug'
ports:
- 8086:8022
depends_on:
- postgres-notificator
- fb-warehouse
volumes:
- ./log-java:/opt/fraudbusters-notificator/tmp
postgres-notificator:
container_name: postgres_notificator
hostname: postgres-notificator
image: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: fb_notificator
PGDATA: /data/postgres
ports:
- 6435:5432
volumes:
- ./postgres/data/4:/data/postgres
restart: unless-stopped
fb-warehouse:
image: ghcr.io/valitydev/fraudbusters-warehouse:sha-251429b
hostname: fb-warehouse
container_name: fb-warehouse
mem_limit: 256m
mem_reservation: 128M
environment:
clickhouse.db.url: "jdbc:clickhouse://clickhouse:8123/default"
clickhouse.db.user: 'user'
clickhouse.db.password: 'password'
logging.config: "./tmp/logback-test.xml"
management.metrics.binders.jvm.enabled: 'false'
spring.profiles.active: 'debug'
ports:
- 8088:8080
depends_on:
- clickhouse
volumes:
- ./log-java:/opt/fraudbusters-warehouse/tmp
fraudbusters-ui:
image: ghcr.io/valitydev/fraudbusters-ui:sha-5661f6f
hostname: fraudbusters-ui
container_name: fraudbusters-ui
environment:
platform: linux/amd64
ports:
- 8989:8080
depends_on:
- fb-management
volumes:
- ./fraudbusters-ui/nginx.conf:/etc/nginx/vhosts.d/fraudbusters-ui.conf
- ./fraudbusters-ui/appConfig.json:/usr/share/nginx/html/assets/appConfig.json
- ./fraudbusters-ui/authConfig.json:/usr/share/nginx/html/assets/authConfig.json
keycloak:
image: docker.io/wizzn/keycloak:14
hostname: keycloak
container_name: keycloak
ports:
- 8080:8080
- 8443:8443
environment:
KEYCLOAK_USER: "admin"
KEYCLOAK_PASSWORD: "admin"
volumes:
- ./keycloak/themes/fraudbusters:/opt/jboss/keycloak/themes/fraudbusters
e2e-test:
build: ./e2e-test
image: e2e-test
container_name: e2e-test
command: dockerize -wait tcp://fb-management:8080 -wait tcp://fraudbusters:8022 -wait tcp://fraudbusters-api:8080 -timeout 20000s -wait-retry-interval 20s bash -c "npm test"
environment:
FB_MNGMT_URL: http://fb-management:8080
FB_API_URL: http://fraudbusters-api:8080
depends_on:
- fb-management
- fraudbusters
- fraudbusters-api
networks:
default:
driver: bridge
driver_opts:
com.docker.network.enable_ipv6: "true"
com.docker.network.bridge.enable_ip_masquerade: "true"
volumes:
mi2: {}