-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
services: | ||
# ZOOKEEPER ------------------------------------------------------------------------------------ | ||
zk: | ||
image: confluentinc/cp-zookeeper:7.4.1 | ||
container_name: zk | ||
ports: | ||
- 2181:2181 | ||
environment: | ||
ZOOKEEPER_CLIENT_PORT: 2181 | ||
ZOOKEEPER_TICK_TIME: 2000 | ||
healthcheck: | ||
test: ["CMD", "echo", "healthy"] | ||
start_period: 5s | ||
interval: 5s | ||
|
||
# KAFKA ---------------------------------------------------------------------------------------- | ||
kafka: | ||
image: confluentinc/cp-kafka:7.4.1 | ||
container_name: kafka | ||
depends_on: | ||
zk: | ||
condition: service_started | ||
ports: | ||
- 9092:9092 | ||
- 29092:29092 | ||
environment: | ||
KAFKA_BROKER_ID: 1 | ||
KAFKA_ZOOKEEPER_CONNECT: zk:2181 | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT | ||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092 | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | ||
healthcheck: | ||
test: "if [[ $(kafka-topics --bootstrap-server localhost:9092 --list | sed '/^[[:blank:]]*$/ d' | wc -l) == 0 ]]; then crash_on_purpose; fi" | ||
start_period: 15s | ||
interval: 20s | ||
|
||
kafka-setup: | ||
image: confluentinc/cp-kafka:7.4.1 | ||
container_name: kafka-setup | ||
depends_on: | ||
kafka: | ||
condition: service_started | ||
command: "bash -c 'echo Waiting for Kafka to be ready... && \ | ||
cub kafka-ready -b kafka:29092 1 20 && \ | ||
kafka-topics --create --if-not-exists --bootstrap-server kafka:29092 --partitions 1 --replication-factor 1 --topic my-awesome-topic'" | ||
environment: | ||
# The following settings are listed here only to satisfy the image's requirements. | ||
# We override the image's `command` anyways, hence this container will not start a broker. | ||
KAFKA_BROKER_ID: ignored | ||
KAFKA_ZOOKEEPER_CONNECT: ignored |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
services: | ||
localstack: | ||
container_name: localstack | ||
image: localstack/localstack:3.0.2 | ||
environment: | ||
# https://docs.localstack.cloud/references/configuration/ | ||
SERVICES: s3, sqs, dynamodb | ||
DEBUG: 1 | ||
ports: | ||
- 4566:4566 | ||
- 4510-4559:4510-4559 | ||
volumes: | ||
# script to be executed when localstack is ready, see https://docs.localstack.cloud/references/init-hooks/ | ||
- "./ready.d:/etc/localstack/init/ready.d:ro" | ||
- /var/run/docker.sock:/var/run/docker.sock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
awslocal s3 mb s3://my-bucket | ||
|
||
awslocal sqs create-queue --queue-name my-sqs-queue | ||
|
||
awslocal dynamodb create-table \ | ||
--table-name my-dynamodb-table \ | ||
--key-schema AttributeName=id,KeyType=HASH \ | ||
--attribute-definitions AttributeName=id,AttributeType=S \ | ||
--billing-mode PAY_PER_REQUEST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
services: | ||
db: | ||
image: postgres:13-alpine | ||
container_name: my-db | ||
volumes: | ||
- ./initdb.d:/docker-entrypoint-initdb.d | ||
healthcheck: | ||
test: psql postgres --command "SELECT 1" -U postgres | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: my_db | ||
ports: | ||
- 5432:5432 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
services: | ||
redis: | ||
image: redis:7.2.0-alpine | ||
container_name: redis | ||
ports: | ||
- "6379:6379" | ||
volumes: | ||
- ./redis.conf:/usr/local/etc/redis/redis.conf:ro | ||
command: "redis-server /usr/local/etc/redis/redis.conf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
user my-username >my-password on ~* -@all +get +set +ttl +scan |