-
Notifications
You must be signed in to change notification settings - Fork 11
/
docker-compose.yml
227 lines (214 loc) · 7.09 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
version: '3.7'
services:
connector:
image: "ghcr.io/flightaware/firestarter/firestarter_connector:${FS_VERSION:-latest}"
build:
context: .
dockerfile: connector/Dockerfile
init: true
networks:
- internal
ports:
# Provides optional access to the raw Firehose stream for consumption
# by non-dockerized applications
- "${STREAMING_PORT:-127.0.0.1:1601}:1601"
environment:
# REQUIRED environment variables
# Firehose account username
- FH_USERNAME=${FH_USERNAME:?FH_USERNAME variable must be set}
# Firehose account key
- FH_APIKEY=${FH_APIKEY:?FH_APIKEY variable must be set}
# Use a single topic for all events to ensure proper ordering per flight
- KAFKA_TOPIC_NAME=events
# OPTIONAL environment variables
# Firehose URL, defaults to firehose-test.flightaware.com.
# firehose.flightaware.com can also be used
- SERVER
# Streaming compression of incoming Firehose data. Valid values are gzip,
# deflate, or compress. Leave blank to disable compression.
- COMPRESSION
# Frequency in seconds to print stats about connection (messages/bytes
# per second). Set to 0 to disable.
- PRINT_STATS_PERIOD
# Frequency in seconds that Firehose should send a synthetic "keepalive"
# message to help connector ensure the connection is still alive. If no
# such message is received within roughly $keepalive seconds, connector
# will automatically reconnect to Firehose.
- KEEPALIVE
# The number of times that the same pitr seen in consecutive keeplive
# messages should trigger an error and a restart of the connection
- KEEPALIVE_STALE_PITRS
# "Time mode" of Firehose init command. Can be "live" or "pitr <pitr>";
# range is currently not supported.
# See https://flightaware.com/commercial/firehose/documentation/commands
# for more details.
- INIT_CMD_TIME
# The "optional" section of the Firehose init command. Mostly consists of
# filters for the data. Do not put username, password, keepalive, or
# compression commands here. Documentation at
# https://flightaware.com/commercial/firehose/documentation/commands
- INIT_CMD_ARGS
# PYTHON settings
- PYTHONUNBUFFERED=1
logging:
driver: "json-file"
options:
max-size: "10mb"
max-file: "5"
depends_on:
- kafka
db-updater:
image: "ghcr.io/flightaware/firestarter/firestarter_db-updater:${FS_VERSION:-latest}"
build:
context: .
dockerfile: db-updater/Dockerfile
init: true
networks:
- internal
environment:
# URL to database that will be updated based on Firehose contents.
# Documentation at https://docs.sqlalchemy.org/en/13/core/engines.html#database-urls
- DB_URL=${FLIGHTS_DB_URL:-sqlite:///db/flights.db}
- PYTHONUNBUFFERED=1
# Same kafka topic name as the producer of the feed that you want to consume
- KAFKA_TOPIC_NAME=events
# Consumers with the same group name will split the data between them,
# but consumers with different group names will each receive all of the messages
- KAFKA_GROUP_NAME=group1
# Set this to "flights" or "positions" depending on what kinds of messages this updater is handling
- TABLE=flights
volumes:
- data:/home/firestarter/app/db
logging:
driver: "json-file"
options:
max-size: "10mb"
max-file: "5"
depends_on:
- kafka
position-db-updater:
image: "ghcr.io/flightaware/firestarter/firestarter_db-updater:${FS_VERSION:-latest}"
build:
context: .
dockerfile: db-updater/Dockerfile
init: true
networks:
- internal
environment:
# URL to database that will be updated based on Firehose contents.
# Documentation at https://docs.sqlalchemy.org/en/13/core/engines.html#database-urls
- DB_URL=${POSITIONS_DB_URL:-postgresql://postgres:positions@timescaledb:5432}
- PYTHONUNBUFFERED=1
# Same kafka topic name as the producer of the feed that you want to consume
- KAFKA_TOPIC_NAME=events
# Consumers with the same group name will split the data between them,
# but consumers with different group names will each receive all of the messages
- KAFKA_GROUP_NAME=position_group1
# Set this to "flights" or "positions" depending on what kinds of messages this updater is handling
- TABLE=positions
logging:
driver: "json-file"
options:
max-size: "10mb"
max-file: "5"
depends_on:
- kafka
- timescaledb
fids-backend:
image: "ghcr.io/flightaware/firestarter/firestarter_fids:${FS_VERSION:-latest}"
build:
context: .
dockerfile: fids/Dockerfile
init: true
networks:
internal:
aliases:
- fids-backend
environment:
# URL to database that is being updated by db-updater.
# Documentation at https://docs.sqlalchemy.org/en/13/core/engines.html#database-urls
- FLIGHTS_DB_URL=${FLIGHTS_DB_URL:-sqlite:///db/flights.db}
- POSITIONS_DB_URL=${POSITIONS_DB_URL:-postgresql://postgres:positions@timescaledb:5432}
- GOOGLE_MAPS_API_KEY=${GOOGLE_MAPS_API_KEY:-}
- PYTHONUNBUFFERED=1
volumes:
- data:/home/firestarter/app/db
logging:
driver: "json-file"
options:
max-size: "10mb"
max-file: "5"
fids-frontend:
image: "ghcr.io/flightaware/fids_frontend/fids-frontend:${FIDS_VERSION:-latest}"
ports:
# Port upon which to serve webapp
- "${WEB_SERVER_PORT:-8080}:80"
networks:
- internal
logging:
driver: "json-file"
options:
max-size: "10mb"
max-file: "5"
map:
image: "ghcr.io/flightaware/firestarter/firestarter_map:${FS_VERSION:-latest}"
build:
context: .
dockerfile: map/Dockerfile
init: true
ports:
# Port upon which to serve webapp
- "${MAP_SERVER_PORT:-5001}:5001"
networks:
- internal
environment:
- PYTHONUNBUFFERED=1
- KAFKA_TOPIC_NAME=events
- KAFKA_GROUP_NAME=map_group
- GOOGLE_MAPS_API_KEY
logging:
driver: "json-file"
options:
max-size: "10mb"
max-file: "5"
depends_on:
- kafka
zookeeper:
image: "bitnami/zookeeper:3.6.2"
init: true
networks:
- internal
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
volumes:
- zookeeper_data:/bitnami/zookeeper
kafka:
image: "bitnami/kafka:3.1"
init: true
networks:
- internal
environment:
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
# Retain messages for 1 hour
- KAFKA_CFG_LOG_RETENTION_HOURS=1
volumes:
- kafka_data:/bitnami/kafka
depends_on:
- zookeeper
timescaledb:
image: "timescale/timescaledb:1.7.4-pg12"
init: true
networks:
- internal
environment:
- POSTGRES_PASSWORD=positions
volumes:
- position_data:/var/lib/postgresql/data
volumes:
data:
position_data:
kafka_data:
zookeeper_data:
networks:
internal: