forked from mindsdb/mindsdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
150 lines (142 loc) · 6.18 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
services:
# Auto-restarts containers that are unhealthy
autoheal:
container_name: autoheal
image: willfarrell/autoheal
volumes:
- /var/run/docker.sock:/var/run/docker.sock
<<: &autoRestartOnFailure
deploy:
restart_policy:
condition: on-failure
max_attempts: 10
mindsdb:
<<: *autoRestartOnFailure
image: mindsdb/mindsdb:devel
depends_on:
postgres:
condition: service_healthy
# Uncomment the following lines if you want to use the local version of otel-collector and langfuse
# otel-collector:
# condition: service_started
# langfuse:
# condition: service_started
# If you want to build the image instead:
# build:
# context: .
# dockerfile: docker/mindsdb.Dockerfile
# target: dev # Makes sure dev dependencies are installed
restart: always
ports:
- '47334:47334'
- '47335:47335'
- '47336:47336'
environment:
MINDSDB_DB_CON: "postgresql://postgres:postgres@postgres/mindsdb"
MINDSDB_DOCKER_ENV: "True"
MINDSDB_STORAGE_DIR: "/mindsdb/var"
FLASK_DEBUG: 1 # This will make sure http requests are logged regardless of log level
SENTRY_IO_DSN: ""
SENTRY_IO_ENVIRONMENT: "local"
# SENTRY_IO_FORCE_RUN: "true" # Uncomment me to force-start sentry on local development. Good for profiling, but may annoy other devs on sentry.io with the "noise"
# MINDSDB_LOG_LEVEL: "DEBUG"
# OPENAI_API_KEY: "..."
LANGFUSE_HOST: "http://langfuse:3000" # Define the host for langfuse
LANGFUSE_PUBLIC_KEY: "pk-lf-1234567890" # Define the public key for langfuse
LANGFUSE_SECRET_KEY: "sk-lf-1234567890" # Define the secret key for langfuse
LANGFUSE_ENVIRONMENT: "local"
LANGFUSE_RELEASE: "local"
# LANGFUSE_DEBUG: "True"
LANGFUSE_TIMEOUT: "10"
LANGFUSE_SAMPLE_RATE: "1.0"
# LANGFUSE_FORCE_RUN: "True"
OTEL_EXPORTER_TYPE: "console" # or "console" # Define the exporter type (console/otlp)
# OTEL_EXPORTER_PROTOCOL: "grpc" # or "http" # Define the protocol for the otlp exporter.
# OTEL_OTLP_ENDPOINT: "http://otel-collector:4317" # Define the endpoint for the otlp exporter.
# OTEL_OTLP_LOGGING_ENDPOINT: "http://otel-collector:4317" # Define if log exporter is different from OTEL_OTLP_ENDPOINT.
# OTEL_OTLP_TRACING_ENDPOINT: "http://otel-collector:4317" # Define if tracing exporter is different from OTEL_OTLP_ENDPOINT.
# OTEL_OTLP_METRICS_ENDPOINT: "http://otel-collector:4317" # Define if metrics exporter is different from OTEL_OTLP_ENDPOINT.
OTEL_SERVICE_NAME: "mindsdb" # Define the service name
OTEL_SERVICE_INSTANCE_ID: "mindsdb-instance" # Define the service instance id
OTEL_SERVICE_ENVIRONMENT: "local" # Define the service environment
OTEL_SERVICE_RELEASE: "local" # Define the service release
OTEL_TRACE_SAMPLE_RATE: "1.0" # Define the trace sample rate
OTEL_EXTRA_ATTRIBUTES: "" # Define the extra attributes
# OTEL_SDK_DISABLED: "false" # Define if the sdk is disabled
# OTEL_LOGGING_DISABLED: "false" # Define if the logging is disabled.
# OTEL_TRACING_DISABLED: "false" # Define if the tracing is disabled.
# OTEL_METRICS_DISABLED: "false" # Define if the metrics are disabled.
# OTEL_SDK_FORCE_RUN: "true" # Uncomment me to force-start opentelemetry on local development.
volumes:
- type: bind
source: .
target: /mindsdb
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:47334/api/util/ping"]
interval: 30s
timeout: 4s
retries: 100
otel-collector:
image: otel/opentelemetry-collector-contrib:0.116.1
environment:
OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED: "true"
volumes:
- ./otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
ports:
- 1888:1888 # pprof extension
- 8888:8888 # Prometheus metrics exposed by the Collector
- 8889:8889 # Prometheus exporter metrics
- 13133:13133 # health_check extension
- 4317:4317 # OTLP gRPC receiver
- 4318:4318 # OTLP http receiver
- 55679:55679 # zpages extension
langfuse:
<<: *autoRestartOnFailure
image: langfuse/langfuse:2.87.0
restart: always
depends_on:
postgres:
condition: service_healthy
ports:
- "3000:3000"
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3000/api/public/health"]
interval: 3s
timeout: 3s
retries: 10
environment:
- DATABASE_URL=postgresql://postgres:postgres@postgres/langfuse
- NEXTAUTH_SECRET=secret # generate secret with at least 256 entropy using `openssl rand -base64 32`.
- SALT=salt # generate secret with at least 256 entropy using `openssl rand -base64 32`.
- ENCRYPTION_KEY=0000000000000000000000000000000000000000000000000000000000000000 # generate secret with at least 256 bits and 64 characters in hex format using `openssl rand -hex 32`.
- NEXTAUTH_URL=http://localhost:3000 # URL of the frontend
- LANGFUSE_INIT_ORG_ID=mindsdb # Organization ID
- LANGFUSE_INIT_ORG_NAME=MindsDB # Organization name
- LANGFUSE_INIT_PROJECT_ID=23152f1d-9604-4629-a69d-27790d47b7fa # Project ID (UUID)
- LANGFUSE_INIT_PROJECT_NAME=MindsDB # Project name
- LANGFUSE_INIT_PROJECT_PUBLIC_KEY=pk-lf-1234567890 # Project public key
- LANGFUSE_INIT_PROJECT_SECRET_KEY=sk-lf-1234567890 # Project secret key
- [email protected] # User email
- LANGFUSE_INIT_USER_NAME=User # User name
- LANGFUSE_INIT_USER_PASSWORD=password # User password
postgres:
<<: *autoRestartOnFailure
image: postgres:16.4
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 3s
timeout: 3s
retries: 10
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
ports:
- "15432:5432" # Expose the port to the host. Use 15432 to avoid conflicts with local postgres installations
volumes:
- db_data:/var/lib/postgresql/data
- ./scripts/init-dbs.sh:/docker-entrypoint-initdb.d/init-dbs.sh
volumes:
db_data:
driver: local