Repository navigation
Expand file tree
/
Copy pathdocker-compose-dev.yml
More file actions
246 lines (238 loc) · 10.3 KB
/
Copy pathdocker-compose-dev.yml
File metadata and controls
246 lines (238 loc) · 10.3 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
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
version: "3"
services:
mysql:
image: mysql:8
volumes:
- mysql-storage:/var/lib/mysql
restart: always
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: admin
MYSQL_DATABASE: lake
MYSQL_USER: merico
MYSQL_PASSWORD: merico
TZ: UTC
command: --character-set-server=utf8mb4
--collation-server=utf8mb4_bin
--skip-log-bin
postgres:
image: postgres:14.2
volumes:
- postgres-storage:/var/lib/postgresql
restart: always
ports:
- 5432:5432
environment:
POSTGRES_DB: lake
POSTGRES_USER: merico
POSTGRES_PASSWORD: merico
TZ: UTC
postgres17:
image: postgres:17.2
volumes:
- postgres17-storage:/var/lib/postgresql
restart: always
ports:
- 5432:5432
environment:
POSTGRES_DB: lake
POSTGRES_USER: merico
POSTGRES_PASSWORD: merico
TZ: UTC
grafana:
image: devlake.docker.scarf.sh/apache/devlake-dashboard:latest
build:
context: grafana/
ports:
- 3002:3000
# host.docker.internal is a Docker Desktop-only DNS alias; this makes it
# resolve on Linux hosts too, so the Prometheus datasource (url from
# $PROMETHEUS_URL, see grafana/provisioning/datasources/prometheus.yml)
# can reach the otel-collector stack running directly on the host.
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./grafana/dashboards:/etc/grafana/dashboards
- ./grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
- grafana-storage:/var/lib/grafana
- ./grafana/dashboards:/etc/grafana/dashboards
environment:
GF_SERVER_ROOT_URL: "${GF_SERVER_ROOT_URL:-http://localhost:3002}"
GF_USERS_DEFAULT_THEME: "light"
GF_SMTP_ENABLED: "${GF_SMTP_ENABLED:-false}"
GF_SMTP_HOST: "${GF_SMTP_HOST:-}"
GF_SMTP_USER: "${GF_SMTP_USER:-}"
# WARNING: Do NOT set GF_SMTP_PASSWORD in the shared .env file.
# Docker Compose reads .env for variable interpolation in all service definitions;
# any value placed there would also reach devlake/config-ui via their env_file.
# Export it in your shell before starting Compose or inject it through deployment secrets.
GF_SMTP_PASSWORD: "${GF_SMTP_PASSWORD:-}"
GF_SMTP_FROM_ADDRESS: "${GF_SMTP_FROM_ADDRESS:-}"
GF_SMTP_FROM_NAME: "${GF_SMTP_FROM_NAME:-Grafana}"
GF_SMTP_STARTTLS_POLICY: "${GF_SMTP_STARTTLS_POLICY:-}"
GF_SMTP_SKIP_VERIFY: "${GF_SMTP_SKIP_VERIFY:-false}"
# Grafana keeps its own users and session. It uses the same customer OIDC
# registration as DevLake, with Grafana's own exact callback URL.
GF_AUTH_GENERIC_OAUTH_ENABLED: "${GRAFANA_OIDC_ENABLED:-false}"
GF_AUTH_GENERIC_OAUTH_NAME: "${GRAFANA_OIDC_NAME:-Google}"
GF_AUTH_GENERIC_OAUTH_CLIENT_ID: "${OIDC_GOOGLE_CLIENT_ID:-}"
GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET: "${OIDC_GOOGLE_CLIENT_SECRET:-}"
GF_AUTH_GENERIC_OAUTH_SCOPES: "${GRAFANA_OIDC_SCOPES:-openid profile email}"
GF_AUTH_GENERIC_OAUTH_AUTH_URL: "${GRAFANA_OIDC_AUTH_URL:-https://accounts.google.com/o/oauth2/v2/auth}"
GF_AUTH_GENERIC_OAUTH_TOKEN_URL: "${GRAFANA_OIDC_TOKEN_URL:-https://oauth2.googleapis.com/token}"
GF_AUTH_GENERIC_OAUTH_API_URL: "${GRAFANA_OIDC_API_URL:-https://openidconnect.googleapis.com/v1/userinfo}"
GF_AUTH_GENERIC_OAUTH_ALLOW_SIGN_UP: "${GRAFANA_OIDC_ALLOW_SIGN_UP:-false}"
GF_AUTH_GENERIC_OAUTH_AUTO_LOGIN: "${GRAFANA_OIDC_AUTO_LOGIN:-false}"
GF_AUTH_DISABLE_LOGIN_FORM: "${GRAFANA_DISABLE_LOGIN_FORM:-false}"
# Match a pre-created Grafana account by its verified OIDC email. This is
# deliberately opt-in: deployments must explicitly accept email-based
# identity linking rather than accidentally enabling it through a default.
GF_AUTH_OAUTH_ALLOW_INSECURE_EMAIL_LOOKUP: "${GF_AUTH_OAUTH_ALLOW_INSECURE_EMAIL_LOOKUP:-false}"
# Stop Grafana re-deriving the org role from the IdP on every sign-in, so a
# role granted by a Grafana Admin persists instead of being overwritten.
# The lake's check reads the live role from /api/org/users either way, so an
# account promoted in Administration -> Users stays an Admin across logins.
#
# Set for all four providers DevLake supports natively plus generic_oauth,
# which everything else falls back to, so behaviour stays identical once the
# multi-provider OIDC work lands and these stop being generic_oauth. Google's
# is already Grafana's default and the others are not configured
# here yet; both are stated anyway so a default change cannot silently
# reintroduce the reset.
GF_AUTH_GENERIC_OAUTH_SKIP_ORG_ROLE_SYNC: "true"
GF_AUTH_GOOGLE_SKIP_ORG_ROLE_SYNC: "true"
GF_AUTH_AZUREAD_SKIP_ORG_ROLE_SYNC: "true"
GF_AUTH_GITLAB_SKIP_ORG_ROLE_SYNC: "true"
GF_AUTH_OKTA_SKIP_ORG_ROLE_SYNC: "true"
MYSQL_URL: mysql:3306
MYSQL_DATABASE: lake
MYSQL_USER: merico
MYSQL_PASSWORD: merico
# Bind-mounts ./grafana/provisioning/datasources, so this must be set even
# before a Grafana image rebuild — Grafana expands $PROMETHEUS_URL to empty
# if the var is missing.
PROMETHEUS_URL: ${PROMETHEUS_URL:-http://host.docker.internal:9090}
TZ: UTC
restart: always
depends_on:
- mysql
otel-auth-init:
image: busybox:1.36
command: ["sh", "-c", "chown -R 1010:1010 /auth && touch /auth/.htpasswd && chmod 755 /auth && chmod 644 /auth/.htpasswd"]
volumes:
- otel-auth:/auth
restart: "no"
devlake:
image: devlake.docker.scarf.sh/apache/devlake:latest
build:
context: backend
args:
HTTPS_PROXY: "${HTTPS_PROXY}"
GOPROXY: "${GOPROXY}"
ports:
- 8080:8080
restart: always
volumes:
- devlake-log:/app/logs
- otel-auth:/var/lib/devlake/otel-auth
extra_hosts:
- "host.docker.internal:host-gateway"
env_file:
- ./.env
# Backend-only OIDC, Grafana-management, and local-password bootstrap
# secrets. This file is ignored and must never be mounted into Config UI.
- path: ./auth-secrets.env
required: false
environment:
LOGGING_DIR: /app/logs
OTEL_AUTH_HTPASSWD_PATH: /var/lib/devlake/otel-auth/.htpasswd
OTEL_PUBLIC_ENDPOINT: "${OTEL_PUBLIC_ENDPOINT:-https://otel-aperture.arbisoft.com}"
OTEL_DEFAULT_PROTOCOL: "${OTEL_DEFAULT_PROTOCOL:-grpc}"
OTEL_RESTART_HELPER_URL: "${OTEL_RESTART_HELPER_URL:-http://host.docker.internal:9199}"
OTEL_RESTART_HELPER_TOKEN: "${OTEL_RESTART_HELPER_TOKEN:-devlake-local-otel-restart-token}"
OTEL_RESTART_HELPER_TIMEOUT_SECONDS: "${OTEL_RESTART_HELPER_TIMEOUT_SECONDS:-45}"
CLAUDE_OTEL_INGEST_TOKEN: "${CLAUDE_OTEL_INGEST_TOKEN:-devlake-local-otel-ingest-token}"
# The backend returns this public proxy URL after logout when native auth is disabled.
AUTH_PROXY_LOGOUT_URL: "${AUTH_PROXY_LOGOUT_URL:-}"
TZ: UTC
# LOGOUT_URI: https://xxx.amazoncognito.com/logout?client_id=yyy&logout_uri=http%3A%2F%2Flocalhost%3A4180%2Foauth2%2Fsign_out
depends_on:
mysql:
condition: service_started
otel-auth-init:
condition: service_completed_successfully
config-ui:
image: devlake.docker.scarf.sh/apache/devlake-config-ui:latest
build:
context: "config-ui"
ports:
- 4000:4000
env_file:
- ./.env
environment:
DEVLAKE_ENDPOINT: devlake:8080
# Keep the Config UI's stable /grafana/ link while Grafana itself serves
# at its own local root URL for the Generic OAuth callback.
USE_EXTERNAL_GRAFANA: "${USE_EXTERNAL_GRAFANA:-true}"
# Internal-only upstream used by Config UI when external routing is disabled.
GRAFANA_ENDPOINT: "${GRAFANA_ENDPOINT:-grafana:3000}"
# Browser-facing URL used only when external Grafana routing is enabled.
GRAFANA_EXTERNAL_URL: "${GRAFANA_EXTERNAL_URL:-http://localhost:3002}"
GRAFANA_OIDC_ENABLED: "${GRAFANA_OIDC_ENABLED:-false}"
GRAFANA_OIDC_LOGIN_URL: "${GRAFANA_OIDC_LOGIN_URL:-}"
TZ: UTC
#ADMIN_USER: devlake
#ADMIN_PASS: letsdivein
depends_on:
- devlake
authproxy:
image: quay.io/oauth2-proxy/oauth2-proxy:v7.15.3
ports:
- 4180:4180
env_file:
- ./.env
# environment:
# Reuse the local Google test client without duplicating its credentials.
# Enter these values in .env
# OAUTH2_PROXY_PROVIDER: google
# OAUTH2_PROXY_CLIENT_ID: ${OIDC_GOOGLE_CLIENT_ID}
# OAUTH2_PROXY_CLIENT_SECRET: ${OIDC_GOOGLE_CLIENT_SECRET}
# OAUTH2_PROXY_COOKIE_SECRET: ${OAUTH2_PROXY_COOKIE_SECRET}
# OAUTH2_PROXY_UPSTREAMS: http://config-ui:4000
# OAUTH2_PROXY_HTTP_ADDRESS: 0.0.0.0:4180
# OAUTH2_PROXY_REDIRECT_URL: http://localhost:4180/oauth2/callback
# OAUTH2_PROXY_EMAIL_DOMAINS: arbisoft.com
# OAUTH2_PROXY_COOKIE_SECURE: "false"
# OAUTH2_PROXY_COOKIE_SAMESITE: lax
# OAUTH2_PROXY_REVERSE_PROXY: "true"
# OAUTH2_PROXY_SKIP_PROVIDER_BUTTON: "true"
# OAUTH2_PROXY_WHITELIST_DOMAINS: localhost:4180
# # DevLake trusts these proxy-provided identity headers when native auth is disabled.
# OAUTH2_PROXY_PASS_USER_HEADERS: "true"
# # Allow only the static post-logout page to bypass Google authentication.
# OAUTH2_PROXY_SKIP_AUTH_ROUTES: "^/signed-out$"
volumes:
mysql-storage:
grafana-storage:
postgres-storage:
postgres17-storage:
devlake-log:
otel-auth:
name: devlake-otel-auth