-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
executable file
·227 lines (215 loc) · 8.38 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
# Airflow sections based on provided example docker-compose.yml included in
# airflow's docs here:
# https://airflow.apache.org/docs/apache-airflow/stable/docker-compose.yaml
---
version: '3.3'
# ============================================================================
# === config shared between containers =======================================
# ============================================================================
x-global-common:
&global-common
environment:
&global-common-env
INFLUXDB_HOSTNAME: http://35.209.104.85:8086
INFLUXDB_TOKEN: ${INFLUXDB_TOKEN}
# ============================================================================
# ============================================================================
# === config shared between all airflow services =============================
# ============================================================================
x-airflow-common:
&airflow-common
build: ./airflow
environment:
&airflow-common-env
AIRFLOW__CORE__EXECUTOR: CeleryExecutor
AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow # TODO: rm this bc it is deprecated
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
AIRFLOW__CORE__FERNET_KEY: ''
AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'false'
AIRFLOW__CORE__LOAD_EXAMPLES: 'false'
AIRFLOW__CORE__PARALLELISM: '1'
UPLOADER_HOSTNAME: http://35.209.104.85:5000
SQLALCHEMY_WARN_20: 0 # set to 1 verbose logging about sqlAlchemy deprecations
AIRFLOW__LOGGING__LOGGING_LEVEL: INFO # DEBUG
AIRFLOW_HOME: /opt/airflow/
# env_file:
# - .env
volumes:
- ./airflow/dags:/opt/airflow/dags
- airflow-logs-volume:/opt/airflow/logs
- ./airflow/plugins:/opt/airflow/plugins
# - /srv/imars-objects:/srv/imars-objects:ro,slave
# - ./airflow/requirements.txt:/requirements.txt
user: "${AIRFLOW_UID:-50000}:${AIRFLOW_GID:-0}" # user & group ID in airflow containers
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
# ============================================================================
services:
nginx:
container_name: nginx
build: ./nginx
restart: unless-stopped
ports:
- 80:80
volumes:
- ./static_files:/usr/share/nginx/html:ro
# docker run -d -p 8080:8080 --name erddap axiom/docker-erddap
erddap:
user: root:4504
container_name: erddap
build: ./erddap
volumes:
- ./erddap/erddap_data:/erddapData
- ./erddap/content:/usr/local/tomcat/content/erddap
# === ERDDAP dataset mounts==============================================
# NOTE: paths must match "fileDir" paths in erddap/content/datsets.xml
- /srv/imars-objects:/srv/erddap-datasets:ro,slave
# =======================================================================
restart: unless-stopped
ports:
- 8080:8080
# sudo docker exec -it erddap bash -c "cd /usr/local/tomcat/webapps/erddap/WEB-INF && bash GenerateDatasetsXml.sh -verbose"
# ==========================================================================
# === grafana dashboard services
# ==========================================================================
grafana:
container_name: grafana
image: grafana/grafana:10.4.4
ports:
- 3000:3000
environment:
<<: *global-common-env
GF_INSTALL_PLUGINS: "alexandra-trackmap-panel,pierosavi-imageit-panel,fatcloud-windrose-panel,https://github.com/USF-IMARS/grafana-erddap/releases/download/1.0.0/grafana-erddap.zip;grafana-erddap"
GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS: "erddap-panel"
GF_PATHS_PROVISIONING: /grafana_provisioning
GF_AUTH_ANONYMOUS_ENABLED: true
GF_SECURITY_ADMIN_USER: imars_grafana_user
GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD}
INFLUXDB_GRAPHITE_HOSTNAME: http://localhost:2003
GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: /grafana_provisioning/dashboards/home_dashboard.json
volumes:
- ./grafana/provisioning:/grafana_provisioning
- grafana-storage:/var/lib/grafana
influxdb:
container_name: influxdb
image: influxdb:2.7.6
ports:
- 8086:8086 # HTTP API
- 2003:2003 # graphite API
volumes:
# init the db by putting .sh or .iql files in /docker-entrypoint-initdb.d
# this should inlcude adding a read-only user for grafana
- ./influxdb/initdb:/docker-entrypoint-initdb.d
# docker data volume:
- influx-data-volume:/var/lib/influxdb
restart: always
environment:
- INFLUXDB_DB=fwc_coral_disease
- INFLUXDB_GRAPHITE_ENABLED=true
- INFLUXDB_HTTP_AUTH_ENABLED=false # TODO: make this true & + users. See
# === logging settings
- INFLUXDB_LOGGING_LEVEL=warn
- INFLUXDB_META_LOGGING_ENABLED=false
# - INFLUXDB_DATA_TRACE_LOGGING_ENABLED=false
- INFLUXDB_DATA_QUERY_LOG_ENABLED=false
- INFLUXDB_HTTP_LOG_ENABLED=false
- INFLUXDB_CONTINUOUS_QUERIES_LOG_ENABLED=false
# === user setup
- DOCKER_INFLUXDB_INIT_MODE=setup
- DOCKER_INFLUXDB_INIT_USERNAME=imars_influx_user
- DOCKER_INFLUXDB_INIT_PASSWORD=${INFLUX_PASSWORD}
- DOCKER_INFLUXDB_INIT_ORG=imars
- DOCKER_INFLUXDB_INIT_BUCKET=imars_bucket
# - DOCKER_INFLUXDB_INIT_RETENTION=1w
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${INFLUX_ADMIN_TOKEN}
# - INFLUXDB_USER=influx_user # See https://github.com/influxdata/influxdata-docker/issues/232
# - INFLUXDB_ADMIN_USER=influx_admin # and https://github.com/influxdata/influxdata-docker/issues/224
# - INFLUXDB_READ_USER=grafana
# - INFLUXDB_WRITE_USER=telegraf
# ==========================================================================
mbon_data_uploader:
container_name: mbon_data_uploader
build: ./mbon_data_uploader
ports:
- 5000:5000
environment:
- FLASK_APP=mbon_data_uploader # TODO: this can be deleted?
- INFLUXDB_HOSTNAME=localhost:8086
# ==========================================================================
# === airflow job orchestration services
# ==========================================================================
postgres:
image: postgres:13
environment:
POSTGRES_USER: airflow
POSTGRES_PASSWORD: airflow # ${POSTGRES_PASSWORD}
POSTGRES_DB: airflow
volumes:
- postgres-db-volume:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "airflow"]
interval: 5s
retries: 5
restart: always
redis:
image: redis:latest
expose:
- 6379:6379
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 30s
retries: 50
restart: always
airflow-webserver:
<<: *airflow-common
command: webserver
ports:
- 8888:8080
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:8080/health"]
interval: 10s
timeout: 10s
retries: 5
restart: always
# container_name: airflow_webserver
# mem_limit: 2048m
airflow-scheduler:
<<: *airflow-common
command: scheduler
restart: always
airflow-worker:
<<: *airflow-common
command: celery worker
restart: always
airflow-init:
<<: *airflow-common
command: version
environment:
<<: *airflow-common-env
_AIRFLOW_DB_UPGRADE: 'true'
_AIRFLOW_WWW_USER_CREATE: 'true'
_AIRFLOW_WWW_USER_USERNAME: ${_AIRFLOW_WWW_USER_USERNAME:-airflow} # un for admin login
_AIRFLOW_WWW_USER_PASSWORD: ${_AIRFLOW_WWW_USER_PASSWORD:-airflow} # pw for admin login
flower:
<<: *airflow-common
command: celery flower
ports:
- 5555:5555
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:5555/"]
interval: 10s
timeout: 10s
retries: 5
restart: always
# ==========================================================================
volumes:
postgres-db-volume:
influx-data-volume:
grafana-storage:
airflow-logs-volume: