2023-03-29 15:37:22 +00:00
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres:15-bullseye
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
restart: on-failure:10
|
|
|
|
environment:
|
|
|
|
POSTGRES_PASSWORD: password
|
|
|
|
POSTGRES_USER: watcher
|
|
|
|
POSTGRES_DB: watcher
|
|
|
|
healthcheck:
|
|
|
|
test: "pg_isready -U watcher -d watcher"
|
|
|
|
interval: 30s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 10
|
|
|
|
start_period: 30s
|
2023-04-07 08:30:01 +00:00
|
|
|
volumes:
|
|
|
|
- ./postgresql:/docker-entrypoint-initdb.d:ro
|
2023-03-29 15:37:22 +00:00
|
|
|
|
|
|
|
kafka:
|
|
|
|
image: docker.redpanda.com/vectorized/redpanda:v22.2.2
|
|
|
|
restart: on-failure:10
|
|
|
|
ports:
|
|
|
|
- 9092:9092
|
|
|
|
command:
|
|
|
|
- redpanda start
|
|
|
|
- --smp 1
|
|
|
|
- --memory 1G
|
|
|
|
- --reserve-memory 0M
|
|
|
|
- --overprovisioned
|
|
|
|
- --node-id 0
|
|
|
|
- --check=false
|
|
|
|
- --pandaproxy-addr PLAINTEXT://0.0.0.0:28082,OUTSIDE://0.0.0.0:8082
|
|
|
|
- --advertise-pandaproxy-addr PLAINTEXT://kafka:8082,OUTSIDE://localhost:8082
|
|
|
|
- --kafka-addr PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092
|
|
|
|
- --advertise-kafka-addr PLAINTEXT://kafka:29092,OUTSIDE://localhost:9092
|
|
|
|
- --rpc-addr 0.0.0.0:33145
|
|
|
|
- --advertise-rpc-addr kafka:33145
|
|
|
|
healthcheck:
|
|
|
|
test: [ "CMD", "rpk", "cluster", "health" ]
|
|
|
|
interval: 30s
|
|
|
|
timeout: 15s
|
|
|
|
retries: 3
|
|
|
|
start_period: 60s
|
|
|
|
|
2023-04-07 08:30:01 +00:00
|
|
|
# This is for viewing the Kafka topics and the contents within it.
|
2023-03-29 15:37:22 +00:00
|
|
|
# If you're like me, you don't really need this bit, just do unit test like usual.
|
|
|
|
# If it's works, that it'll work.
|
|
|
|
kafka-console:
|
|
|
|
image: docker.redpanda.com/vectorized/console:latest
|
|
|
|
environment:
|
|
|
|
KAFKA_BROKERS: kafka:29092
|
|
|
|
ports:
|
|
|
|
- 8080:8080
|
|
|
|
depends_on:
|
|
|
|
kafka:
|
|
|
|
condition: service_healthy
|
|
|
|
|
|
|
|
inserter:
|
|
|
|
build: ./inserter
|
|
|
|
environment:
|
|
|
|
DATABASE_URL: "postgresql://watcher:password@postgres:5432/watcher?sslmode=disable"
|
|
|
|
restart: on-failure:5
|
|
|
|
depends_on:
|
|
|
|
postgres:
|
2023-04-07 08:30:01 +00:00
|
|
|
condition: service_healthy
|
|
|
|
|
|
|
|
balance-processor:
|
|
|
|
build: ./balance-processor
|
|
|
|
environment:
|
|
|
|
KAFKA_ADDRESSES: "kafka:9092"
|
|
|
|
restart: on-failure:5
|
|
|
|
depends_on:
|
|
|
|
kafka:
|
|
|
|
condition: service_healthy
|
|
|
|
|
|
|
|
customer-list:
|
|
|
|
build: ./customer-list
|
|
|
|
ports:
|
|
|
|
- 7201:7201
|
|
|
|
environment:
|
|
|
|
DATABASE_URL: "postgresql://watcher:password@postgres:5432/watcher?sslmode=disable"
|
|
|
|
restart: on-failure:5
|
|
|
|
depends_on:
|
|
|
|
postgres:
|
|
|
|
condition: service_healthy
|
|
|
|
|
|
|
|
# This is your space now.
|
|
|
|
# If you are developing the application, you can comment these out.
|
|
|
|
watcher:
|
|
|
|
build: ./watcher
|
|
|
|
environment:
|
|
|
|
DATABASE_URL: "postgresql://watcher:password@postgres:5432/watcher?sslmode=disable"
|
|
|
|
KAFKA_ADDRESSES: "kafka:9092"
|
|
|
|
restart: on-failure:5
|
|
|
|
depends_on:
|
|
|
|
kafka:
|
|
|
|
condition: service_healthy
|
|
|
|
postgres:
|
|
|
|
condition: service_healthy
|
|
|
|
|
|
|
|
swimmer:
|
|
|
|
build: ./swimmer
|
|
|
|
environment:
|
|
|
|
KAFKA_ADDRESSES: "kafka:9092"
|
|
|
|
restart: on-failure:5
|
|
|
|
depends_on:
|
|
|
|
kafka:
|
|
|
|
condition: service_healthy
|
|
|
|
|