-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
146 lines (137 loc) · 3.93 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
services:
zookeeper:
image: bitnami/zookeeper:latest
container_name: aequitas-zookeeper
platform: &platform
linux/x86_64
ports:
- ${ZOOKEEPER_PORT}:2181
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
healthcheck:
test: ["CMD-SHELL", "echo mntr | nc localhost 2181 | grep zk_version | grep -q zk_version"]
interval: 1m
timeout: 2s
retries: 5
start_period: 10s
restart: on-failure
networks:
- internal
kafka:
image: bitnami/kafka:latest
container_name: ${KAFKA_HOST}
platform: *platform
ports:
- ${KAFKA_PORT}:${KAFKA_PORT}
- ${KAFKA_EXTERNAL_PORT}:${KAFKA_EXTERNAL_PORT}
environment:
- KAFKA_BROKER_ID=1
- KAFKA_CFG_LISTENERS=PLAINTEXT://:${KAFKA_PORT},EXTERNAL://:${KAFKA_EXTERNAL_PORT}
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://${KAFKA_HOST}:${KAFKA_PORT},EXTERNAL://${KAFKA_EXTERNAL_HOST}:${KAFKA_EXTERNAL_PORT}
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_DEFAULT_REPLICATION_FACTOR=1
- KAFKA_MESSAGE_MAX_BYTES=200000000
- KAFKA_DELETE_TOPIC_ENABLE=true
healthcheck:
test: ["CMD", "kafka-broker-api-versions.sh", "--bootstrap-server", "localhost:${KAFKA_PORT}"]
interval: 10s
timeout: 10s
retries: 5
start_period: 30s
depends_on:
zookeeper:
condition: service_healthy
restart: on-failure
networks:
- internal
# kafka-ui:
# container_name: kafka-ui
# image: provectuslabs/kafka-ui:latest
# platform: *platform
# ports:
# - "${KAFKA_UI_PORT}:8080"
# environment:
# DYNAMIC_CONFIG_ENABLED: 'true'
# KAFKA_CLUSTERS_0_NAME: cluster
# KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: ${KAFKA_HOST}:${KAFKA_PORT}
# depends_on:
# kafka:
# condition: service_healthy
# networks:
# - internal
frontend:
image: aequitaseu/frontend:latest
container_name: ${AEQUITAS_FRONTEND_HOST}
ports:
- "${AEQUITAS_FRONTEND_PORT}:80"
environment:
NEXT_PUBLIC_BACKEND_URL: localhost:${AEQUITAS_BACKEND_PORT}
depends_on:
backend:
condition: service_healthy
backend:
build: .
image: aequitaseu/backend:latest
platform: *platform
container_name: ${AEQUITAS_BACKEND_HOST}
restart: on-failure
ports:
- ${AEQUITAS_BACKEND_PORT}:${AEQUITAS_BACKEND_PORT}
environment:
AEQUITAS_BACKEND_PORT: ${AEQUITAS_BACKEND_PORT}
ENV: production
healthcheck:
test: ["CMD", "python", "-c", "import requests; assert requests.get('http://localhost:${AEQUITAS_BACKEND_PORT}/questions').status_code == 200"]
interval: 5s
timeout: 5s
retries: 3
start_period: 10s
depends_on:
db:
condition: service_healthy
kafka:
condition: service_healthy
networks:
- internal
db:
image: neo4j:2025
# platform: *platform
container_name: ${DB_HOST}
restart: always
environment:
NEO4J_AUTH: neo4j/${DB_PASSWORD}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
NEO4JLABS_PLUGINS: '["apoc", "apoc-extended"]'
NEO4J_apoc_export_file_enabled: true
NEO4J_apoc_import_file_enabled: true
NEO4J_apoc_import_file_use__neo4j__config: false
NEO4J_apoc_initializer_neo4j: CALL apoc.cypher.runFile("/neo4j-init.cypher")
ports:
- '7474:7474'
- '7687:7687'
volumes:
- data:/data
- plugins:/plugins
- ./resources/db/init.cypher:/neo4j-init.cypher
- type: bind
source: ./neo4j-healthcheck.sh
target: /neo4j-healthcheck.sh
healthcheck:
test: bash /neo4j-healthcheck.sh
interval: 1m
timeout: 5s
retries: 5
start_period: 45s
networks:
- internal
volumes:
data:
driver: local
plugins:
driver: local
networks:
internal:
driver: bridge