-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
167 lines (157 loc) · 4.96 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# mittaridatapumppu-deviceregistry
version: '3.8'
services:
endpoint:
image: ghcr.io/city-of-helsinki/mittaridatapumppu-endpoint:latest
build: ./mittaridatapumppu-endpoint
ports:
- "8001:8000"
depends_on:
kafka:
condition: service_healthy
restart: unless-stopped
volumes:
- ./mittaridatapumppu-endpoint:/home/app
- ./fvhiot-python/fvhiot:/home/app/fvhiot
environment:
ENDPOINT_CONFIG_URL: "http://deviceregistry:8000/api/v1/hosts/localhost/"
DEVICE_REGISTRY_TOKEN: "abcdef1234567890abcdef1234567890abcdef12"
KAFKA_BOOTSTRAP_SERVERS: "kafka:9092"
UVICORN_LOG_LEVEL: "debug"
UVICORN_RELOAD: "true"
DEBUG: 1
parser-digita:
image: ghcr.io/city-of-helsinki/mittaridatapumppu-parser:latest
build: ./mittaridatapumppu-parser
container_name: parser-digita
depends_on:
kafka:
condition: service_healthy
restart: unless-stopped
volumes:
- ./fvhiot-python/fvhiot:/home/app/fvhiot
environment:
# Kafka client config
KAFKA_BOOTSTRAP_SERVERS: "kafka:9092"
KAFKA_GROUP_ID: "digita_dev"
KAFKA_PARSED_DATA_TOPIC_NAME: "digita.parseddata"
KAFKA_RAW_DATA_TOPIC_NAME: "digita.rawdata"
# Parser config
DEVICE_REGISTRY_URL: "http://deviceregistry:8000/api/v1"
DEVICE_REGISTRY_TOKEN: abcdef1234567890abcdef1234567890abcdef12
# Debug config
DEBUG: 1
persister-influxdb:
image: ghcr.io/city-of-helsinki/mittaridatapumppu-persister:latest
build: ./mittaridatapumppu-persister
container_name: persister-influxdb
depends_on:
kafka:
condition: service_healthy
# influxdb2:
# condition: service_healthy
restart: unless-stopped
volumes:
- ./fvhiot-python/fvhiot:/home/app/fvhiot
environment:
# Kafka client config
KAFKA_BOOTSTRAP_SERVERS: "kafka:9092"
KAFKA_GROUP_ID: "digita_dev"
KAFKA_PARSED_DATA_TOPIC_NAME: "digita.parseddata"
KAFKA_RAW_DATA_TOPIC_NAME: "digita.rawdata"
# Persister config
DEVICE_REGISTRY_URL: "http://deviceregistry:8000/api/v1"
DEVICE_REGISTRY_TOKEN: abcdef1234567890abcdef1234567890abcdef12
# InfluxDB config
INFLUX_HOST: "http://influxdb2:8086"
INFLUX_ORG: "Development"
INFLUX_BUCKET: "devbucket"
INFLUX_TOKEN: "insercure-token-for-development-and-testing-purposes-only-KxU4jAU23H3vTk"
# Debug config
DEBUG: 1
kafka:
image: bitnami/kafka:3.4
ports:
- "9092:9092"
volumes:
- "kafka_data:/bitnami"
environment:
KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: "true"
# Kafka KRaft settings
KAFKA_CFG_NODE_ID: 0
KAFKA_CFG_PROCESS_ROLES: "controller,broker"
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: "0@kafka:9093"
# Listeners
KAFKA_CFG_LISTENERS: "PLAINTEXT://:9092,CONTROLLER://:9093"
KAFKA_CFG_ADVERTISED_LISTENERS: "PLAINTEXT://:9092"
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: "CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT"
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: "CONTROLLER"
KAFKA_CFG_INTER_BROKER_LISTENER_NAME: "PLAINTEXT"
healthcheck:
interval: 10s
retries: 3
test: kafka-topics.sh --bootstrap-server kafka:9092 --topic hc --create --if-not-exists && kafka-topics.sh --bootstrap-server kafka:9092 --topic hc --describe
timeout: 5s
deviceregistry:
image: ghcr.io/city-of-helsinki/mittaridatapumppu-deviceregistry:latest
build: .
container_name: deviceregistry
volumes:
- ./mittaridatapumppu-deviceregistry:/home/app
- media:/media
ports:
- "8000:8000"
environment:
# Device registry config
DJANGO_SETTINGS_MODULE: "deviceregistry.settings"
ALLOWED_HOSTS:
SECRET_KEY:
# PostgreSQL config
DJANGO_DB_HOST:
DJANGO_DB_NAME:
DJANGO_DB_USER:
DJANGO_DB_PASSWORD:
DJANGO_DB_PORT:
# Debug config
UVICORN_LOG_LEVEL: "debug"
UVICORN_RELOAD: "true"
DEBUG: 1
# UVICORN_RELOAD: true
# UVICORN_LOG_LEVEL: true
depends_on:
db:
condition: service_healthy
db:
image: postgis/postgis:16-3.4
ports:
- "5432:5432"
environment:
POSTGRES_PASSWORD: postgres
volumes:
- postgres_data:/var/lib/postgresql/data/
healthcheck:
test: "pg_isready -U postgres -d postgres"
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
influxdb2:
image: influxdb:2.7
ports:
- "18086:8086"
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: root
DOCKER_INFLUXDB_INIT_PASSWORD: ruutruut
DOCKER_INFLUXDB_INIT_ORG: Development
DOCKER_INFLUXDB_INIT_BUCKET: devbucket
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: "insercure-token-for-development-and-testing-purposes-only-KxU4jAU23H3vTk"
healthcheck:
test: "curl --fail localhost:8086/health"
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres_data:
media:
kafka_data: