fleet/docker-compose.yml
Lucas Manuel Rodriguez 78df7b6f70
Add guide on how to simulate slow connections to redis and mysql (#9140)
* Add guide on how to simulate slow connections to redis and mysql

* Add pageOrderInSection
2023-01-03 17:29:40 -03:00

218 lines
5.8 KiB
YAML

---
version: "2"
services:
# To test with MariaDB, set FLEET_MYSQL_IMAGE to mariadb:10.6 or the like (note MariaDB is not
# officially supported).
# To run in macOS M1, set FLEET_MYSQL_IMAGE=arm64v8/mysql:oracle FLEET_MYSQL_PLATFORM=linux/arm64/v8
mysql:
image: ${FLEET_MYSQL_IMAGE:-mysql:5.7}
platform: ${FLEET_MYSQL_PLATFORM:-linux/x86_64}
volumes:
- mysql-persistent-volume:/tmp
command:
[
"mysqld",
"--datadir=/tmp/mysqldata",
# These 3 keys run MySQL with GTID consistency enforced to avoid issues with production deployments that use it.
"--enforce-gtid-consistency=ON",
"--log-bin=bin.log",
"--server-id=master-01",
# Required for storage of Apple MDM installers.
"--max_allowed_packet=536870912"
]
environment:
&mysql-default-environment
MYSQL_ROOT_PASSWORD: toor
MYSQL_DATABASE: fleet
MYSQL_USER: fleet
MYSQL_PASSWORD: insecure
ports:
- "3306:3306"
mysql_test:
image: ${FLEET_MYSQL_IMAGE:-mysql:5.7}
platform: ${FLEET_MYSQL_PLATFORM:-linux/x86_64}
# innodb-file-per-table=OFF gives ~20% speedup for test runs.
command:
[
"mysqld",
"--datadir=/tmpfs",
"--slow_query_log=1",
"--log_output=TABLE",
"--log-queries-not-using-indexes",
"--innodb-file-per-table=OFF",
# These 3 keys run MySQL with GTID consistency enforced to avoid issues with production deployments that use it.
"--enforce-gtid-consistency=ON",
"--log-bin=bin.log",
"--server-id=master-01",
# Required for storage of Apple MDM installers.
"--max_allowed_packet=536870912"
]
environment: *mysql-default-environment
ports:
- "3307:3306"
tmpfs:
- /var/lib/mysql:rw,noexec,nosuid
- /tmpfs
mailhog:
image: mailhog/mailhog:latest
ports:
- "8025:8025"
- "1025:1025"
redis:
image: redis:5
ports:
- "6379:6379"
redis-cluster-setup:
image: redis:5
command: redis-cli --cluster create 172.20.0.31:7001 172.20.0.32:7002 172.20.0.33:7003 172.20.0.34:7004 172.20.0.35:7005 172.20.0.36:7006 --cluster-yes --cluster-replicas 1
networks:
cluster_network:
ipv4_address: 172.20.0.30
depends_on:
- redis-cluster-1
- redis-cluster-2
- redis-cluster-3
- redis-cluster-4
- redis-cluster-5
- redis-cluster-6
redis-cluster-1:
image: redis:5
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- "7001:7001"
volumes:
- ./tools/redis-tests/redis-cluster-1.conf:/usr/local/etc/redis/redis.conf
networks:
cluster_network:
ipv4_address: 172.20.0.31
redis-cluster-2:
image: redis:5
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- "7002:7002"
volumes:
- ./tools/redis-tests/redis-cluster-2.conf:/usr/local/etc/redis/redis.conf
networks:
cluster_network:
ipv4_address: 172.20.0.32
redis-cluster-3:
image: redis:5
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- "7003:7003"
volumes:
- ./tools/redis-tests/redis-cluster-3.conf:/usr/local/etc/redis/redis.conf
networks:
cluster_network:
ipv4_address: 172.20.0.33
redis-cluster-4:
image: redis:5
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- "7004:7004"
volumes:
- ./tools/redis-tests/redis-cluster-4.conf:/usr/local/etc/redis/redis.conf
networks:
cluster_network:
ipv4_address: 172.20.0.34
redis-cluster-5:
image: redis:5
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- "7005:7005"
volumes:
- ./tools/redis-tests/redis-cluster-5.conf:/usr/local/etc/redis/redis.conf
networks:
cluster_network:
ipv4_address: 172.20.0.35
redis-cluster-6:
image: redis:5
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- "7006:7006"
volumes:
- ./tools/redis-tests/redis-cluster-6.conf:/usr/local/etc/redis/redis.conf
networks:
cluster_network:
ipv4_address: 172.20.0.36
saml_idp:
image: fleetdm/docker-idp:latest
environment:
SIMPLESAMLPHP_SP_ENTITY_ID: "https://localhost:8080"
SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE: "https://localhost:8080/api/v1/fleet/sso/callback"
volumes:
- ./tools/saml/users.php:/var/www/simplesamlphp/config/authsources.php
ports:
- "9080:8080"
- "9443:8443"
# CAdvisor container allows monitoring other containers. Useful for
# development.
cadvisor:
image: google/cadvisor:latest
ports:
- "5678:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
prometheus:
image: prom/prometheus:latest
ports:
- "9090:9090"
volumes:
- ./tools/app/prometheus.yml:/etc/prometheus/prometheus.yml
# localstack to simulate AWS integrations like firehose & kinesis
# use http://localhost:4566 as the `--endpoint-url` argument in awscli
localstack:
image: localstack/localstack
ports:
- "4566:4566"
- "4571:4571"
environment:
- SERVICES=firehose,kinesis
# s3 compatible object storage (file carving backend)
minio:
image: quay.io/minio/minio
command: server /data --console-address ":9001"
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123!
volumes:
- data-minio:/data
toxiproxy:
image: shopify/toxiproxy
ports:
- "22220:22220"
- "8474:8474"
volumes:
mysql-persistent-volume:
data-minio:
networks:
cluster_network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/24