-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
176 lines (168 loc) · 6.51 KB
/
Copy pathdocker-compose.yml
File metadata and controls
176 lines (168 loc) · 6.51 KB
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
# ERDDAP example docker compose stack
#
# By default, running this compose file with `docker compose up -d`
# will build the ERDDAP docker image from source and run it on
# HTTP port 8080, with ERDDAP available at http://localhost:8080.
# Note that the automatic image build happens only once. To re-build
# the image (i.e. after changes are made to the source code), run
# `docker compose build`.
#
# The following environment variables can be set to change behavior,
# either in an .env file in the same directory as docker-compose.yml,
# on the command line when executing `docker compose`
# (e.g. `ERDDAP_MEMORY=8g docker compose up -d`), or by configuring
# your local environment accordingly.
#
# ERDDAP_MEMORY - amount of memory available to ERDDAP JVM (example 6g)
# ERDDAP_CONTAINER_MEM_LIMIT - overall amount of memory available to ERDDAP container (example 8g)
# ERDDAP_HOST - hostname for the ERDDAP server (example your.domain)
# ERDDAP_baseUrl - Base HTTP ERDDAP url (example http://localhost:8080)
# ERDDAP_baseHttpsUrl - Base HTTPS ERDDAP url (example https://your.domain)
# ERDDAP_LOCAL_HTTP_PORT - Local port on which to serve ERDDAP HTTP (example 8080)
# ERDDAP_DEBUG_PORT - Local port on which to run ERDDAP remote debug server (example 8000)
# NGINX_PROXY_HTTP_PORT - Port for nginx-proxy HTTP (example 80)
# NGINX_PROXY_HTTPS_PORT - Port for nginx-proxy HTTPS (example 443)
# GRAFANA_PUBLIC_HOST - Public hostname for Grafana. Only set if you are running
# both the monitoring and ngnix-proxy profiles, and want
# your grafana server to be publicly accessible (still password protected).
# PROMETHEUS_LOCAL_HTTP_PORT - Local port on which to run Prometheus (default 9090)
# GRAFANA_LOCAL_HTTP_PORT - Local port on which to serve Grafana (default 3000)
#
#
# Example .env file:
#
# ERDDAP_HOST=my.domain
# ERDDAP_MEMORY=10g
#
# More information on setting environment variables for docker compose:
# https://docs.docker.com/compose/how-tos/environment-variables/set-environment-variables/
# https://docs.docker.com/compose/how-tos/environment-variables/variable-interpolation/#env-file
#
# Automated SSL/TLS/HTTPS using nginx-proxy and acme-companion
#
# An nginx server including automated SSL certificate creation and renewal
# using nginx-proxy and acme-companion can be included in the stack by enabling
# the `nginx-proxy` profile. Make sure that the `ERDDAP_HOST` environment variable
# is set to a public hostname routing ports 80 and 443 to your server, and then
# bring up the stack using `docker compose --profiles nginx-proxy up -d`
# or set environment variable `COMPOSE_PROFILES=nginx-proxy` and use
# `docker compose up -d` normally.
#
# The included configuration uses HTTP-01 challenges but DNS-01
# is also possible. See the letsencrypt and acme-companion
# documentation for more details.
#
# https://github.com/nginx-proxy/nginx-proxy
# https://github.com/nginx-proxy/acme-companion
# https://letsencrypt.org/docs/
services:
erddap:
build: .
ports:
- "${ERDDAP_LOCAL_HTTP_PORT:-8080}:8080"
- "${ERDDAP_DEBUG_PORT:-8000}:8000"
volumes:
- data:/erddapData
# create ./erddapContent directory with datasets.xml and
# and uncoment the following line to load custom configuration
# ./erddapContent:/usr/local/tomcat/content/erddap
environment:
ERDDAP_MEMORY: "${ERDDAP_MEMORY:-4g}"
ERDDAP_baseUrl: "${ERDDAP_baseUrl:-http://${ERDDAP_HOST:-localhost:${ERDDAP_LOCAL_HTTP_PORT:-8080}}}"
ERDDAP_baseHttpsUrl: "${ERDDAP_baseHttpsUrl:-https://${ERDDAP_HOST:-}}"
ERDDAP_enableCors: "true"
#ERDDAP_corsAllowOrigin: "https://some-allowed-domain.com,http://this-one-also.org:8080"
#JAVA_OPTS: "-agentlib:jdwp=transport=dt_socket,address=*:8000,server=y,suspend=n"
#for nginx-proxy/acme-companion use below
VIRTUAL_HOST: "${ERDDAP_HOST:-}"
VIRTUAL_PORT: 8080
LETSENCRYPT_HOST: "${ERDDAP_HOST:-}"
mem_limit: "${ERDDAP_CONTAINER_MEM_LIMIT:-6g}"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-fl", "http://localhost:8080/erddap/index.html"]
interval: 15s
timeout: 5s
retries: 3
logs:
image: debian:bookworm-slim
volumes:
- data:/erddapData:ro
mem_limit: 256m
depends_on:
erddap:
condition: service_healthy
restart: unless-stopped
command: tail -F /erddapData/logs/log.txt
# Monitoring services (part of the monitoring profile)
prometheus:
image: prom/prometheus:latest
volumes:
- ./docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=30d'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--web.enable-lifecycle'
ports:
- "${PROMETHEUS_LOCAL_HTTP_PORT:-9090}:9090"
restart: unless-stopped
profiles:
- monitoring
grafana:
image: grafana/grafana:latest
volumes:
- grafana_data:/var/lib/grafana
- ./docker/prometheus/grafana/provisioning:/etc/grafana/provisioning
- ./docker/prometheus/grafana/dashboards:/var/lib/grafana/dashboards
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: "${GF_SECURITY_ADMIN_PASSWORD:-erddapadmin}"
GF_USERS_ALLOW_SIGN_UP: false
GF_INSTALL_PLUGINS: grafana-clock-panel,grafana-piechart-panel
VIRTUAL_HOST: "${GRAFANA_PUBLIC_HOST:-}"
LETSENCRYPT_HOST: "${GRAFANA_PUBLIC_HOST:-}"
ports:
- "${GRAFANA_LOCAL_HTTP_PORT:-3000}:3000"
depends_on:
- prometheus
restart: unless-stopped
profiles:
- monitoring
nginx-proxy:
image: nginxproxy/nginx-proxy:1.7
ports:
- "${NGINX_PROXY_HTTP_PORT:-80}:80"
- "${NGINX_PROXY_HTTPS_PORT:-443}:443"
volumes:
- html:/usr/share/nginx/html
- certs:/etc/nginx/certs:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
environment:
DEFAULT_HOST: "${ERDDAP_HOST:-}"
restart: unless-stopped
profiles:
- nginx-proxy
acme-companion:
image: nginxproxy/acme-companion:2.5
volumes_from:
- nginx-proxy
volumes:
- certs:/etc/nginx/certs
- acme:/etc/acme.sh
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
DEFAULT_EMAIL: shane@axds.co
restart: unless-stopped
profiles:
- nginx-proxy
volumes:
acme:
certs:
data:
prometheus_data:
grafana_data:
html: