Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
124 lines (118 loc) · 5.3 KB
/
Copy pathcompose.yaml
File metadata and controls
124 lines (118 loc) · 5.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
# 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.
services:
solr:
image: solr:9-slim
ports:
- "8983:8983"
networks: [ search ]
environment:
ZK_HOST: "zoo:2181"
SOLR_HEAP: "1g"
depends_on: [ zoo ]
volumes:
- data:/var/solr
- ./mydata:/mydata
- ./init-solr.sh:/init-solr.sh
command: [ "bash", "/init-solr.sh" ]
zoo:
image: zookeeper:3.9
networks: [ search ]
environment:
ZOO_4LW_COMMANDS_WHITELIST: "mntr,conf,ruok"
# =============================================================================
# OpenTelemetry LGTM Stack (HTTP mode only)
# =============================================================================
# Provides a complete observability stack for local development:
# - Grafana: Visualization dashboards (http://localhost:3000)
# - Loki: Log aggregation
# - Tempo: Distributed tracing
# - Prometheus: Metrics storage (the default Grafana datasource)
# - Pyroscope: Continuous profiling
# - OpenTelemetry Collector: Receives OTLP data on ports 4317 (gRPC) and 4318 (HTTP)
#
# Usage:
# docker compose up -d lgtm # Start only the observability stack
# docker compose up -d # Start everything including Solr
#
# Access Grafana at http://localhost:3000. Anonymous access is enabled but
# read-only (Viewer), and the UI is published on the loopback interface only,
# so it is not reachable from other hosts on your network.
#
# To grant anonymous Admin (e.g. to edit dashboards), opt in explicitly:
# GF_ANON_ROLE=Admin docker compose up -d lgtm
# To expose the UI beyond loopback on a trusted network, set the bind address:
# GRAFANA_BIND=0.0.0.0 docker compose up -d lgtm
#
# Pre-configured datasources: Prometheus (default), Loki, Tempo, Pyroscope.
lgtm:
image: grafana/otel-lgtm:0.33.0
labels:
# Prevent Spring Boot auto-configuration from trying to manage this service
org.springframework.boot.ignore: "true"
ports:
# Loopback-only by default: anonymous Grafana on 0.0.0.0 would hand the
# dashboards to anyone who can reach this machine.
- "${GRAFANA_BIND:-127.0.0.1}:3000:3000" # Grafana UI
- "${OTLP_BIND:-127.0.0.1}:4317:4317" # OTLP gRPC receiver
- "${OTLP_BIND:-127.0.0.1}:4318:4318" # OTLP HTTP receiver
networks: [ search ]
environment:
# Anonymous access for local development, read-only unless overridden.
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: "${GF_ANON_ROLE:-Viewer}"
# =============================================================================
# Keycloak - the identity provider the http profile authenticates against
# =============================================================================
# Gated behind the `http` compose profile so a plain `docker compose up -d` (STDIO users) does not
# start it; the http Spring profile activates it via spring.docker.compose.profiles.active. The realm is
# imported from keycloak/solr-mcp-realm.json, so the clients and — critically — the audience
# protocol mapper exist before the server ever asks for a token.
#
# The mapper is what makes tokens acceptable here. Keycloak does not honour the RFC 8707
# `resource=` parameter, so without it a token is issued normally and then rejected by
# validateAudienceClaim(true) with a 401. See docs/security/keycloak.md.
#
# The healthcheck is not decoration: the server resolves the issuer at startup and fails to boot
# if the realm is not yet answering, so Spring Boot must wait for this container to be healthy
# before the application context starts.
# Keycloak 26's minimal image (UBI 9) intentionally omits curl and wget, and health endpoints are
# exposed on the dedicated management port 9000. This probe follows Keycloak's official Containerfile
# HEALTHCHECK recommendation (https://www.keycloak.org/observability/health#_healthcheck) using
# bash's built-in /dev/tcp socket redirection.
keycloak:
profiles: [ http ]
image: quay.io/keycloak/keycloak:26.0
ports:
- "8180:8080"
networks: [ search ]
environment:
KC_BOOTSTRAP_ADMIN_USERNAME: admin
KC_BOOTSTRAP_ADMIN_PASSWORD: admin
KC_HEALTH_ENABLED: "true"
command: [ "start-dev", "--import-realm" ]
volumes:
- ./keycloak:/opt/keycloak/data/import:ro
healthcheck:
test: [ "CMD-SHELL", "{ printf 'HEAD /health/ready HTTP/1.0\\r\\n\\r\\n' >&0; grep 'HTTP/1.0 200'; } 0<>/dev/tcp/localhost/9000" ]
interval: 5s
timeout: 5s
retries: 30
start_period: 10s
volumes:
data:
networks:
search:
driver: bridge