-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
88 lines (84 loc) · 2.43 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
version: '3.8'
services:
# front:
back:
# build: ./backend
image: werrer/filmoteka-api:v1.2
environment:
DOCKER_CONFIG_PATH: ${BACK_DOCKER_CONFIG_PATH}
hostname: backend
depends_on:
database:
condition: service_healthy
# rabbitmq:
# condition: service_healthy
kafka:
condition: service_healthy
ports:
- 8081:8081
volumes:
- ./backend/configs/config.toml:/configs/config.toml
database:
image: postgres
hostname: database
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
# ports:
# - "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
volumes:
- ./data/init.sql:/docker-entrypoint-initdb.d/init.sql
zookeeper:
image: 'confluentinc/cp-zookeeper:latest'
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
image: 'confluentinc/cp-kafka:latest'
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9092,OUTSIDE://localhost:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_AUTO_CREATE_TOPICS_ENABLE: false
ports:
- "9092:9092"
- "29092:29092"
healthcheck:
test: ["CMD", "bash", "-c", "kafka-broker-api-versions --bootstrap-server kafka:9092 > /dev/null 2>&1"]
interval: 30s
timeout: 10s
retries: 5
kafka-setup:
image: 'confluentinc/cp-kafka:latest'
depends_on:
- kafka
entrypoint: >
bash -c "
/usr/bin/kafka-topics --create --topic ${BROKER_TOPIC_NAME}
--bootstrap-server kafka:9092
--partitions 1 --replication-factor 1
"
ms:
# build: ./mail_sender
image: werrer/filmoteka-mail-sender:v1.1
hostname: mail_sender
environment:
DOCKER_CONFIG_PATH: ${MAIL_DOCKER_CONFIG_PATH}
depends_on:
# rabbitmq:
# condition: service_healthy
kafka:
condition: service_healthy
volumes:
- ./mail_sender/configs/config.toml:/configs/config.toml
- ./mail_sender/templates/mail_body.html:/templates/mail_body.html