-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose-logging.yml
163 lines (153 loc) · 4.29 KB
/
docker-compose-logging.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
# Usage
# Start: docker compose -f docker-compose.yml -f docker-compose-logging.yml up
# With helpers: docker compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml -f docker-compose-logging.yml up
# Stop: docker compose down
# Destroy: docker compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml -f docker-compose-logging.yml down -v --remove-orphans
# Please refer to https://supabase.com/docs/reference/self-hosting-analytics/introduction
version: "3.8"
services:
studio:
logging:
driver: syslog
options:
syslog-address: "tcp://localhost:${VECTOR_PORT}"
tag: studio
depends_on:
analytics:
condition: service_healthy
environment:
LOGFLARE_API_KEY: ${LOGFLARE_API_KEY}
LOGFLARE_URL: http://analytics:4000
NEXT_PUBLIC_ENABLE_LOGS: true
kong:
logging:
driver: syslog
options:
syslog-address: "tcp://localhost:${VECTOR_PORT}"
tag: kong
depends_on:
analytics:
condition: service_healthy
auth:
depends_on:
analytics:
condition: service_healthy
logging:
driver: syslog
options:
syslog-address: "tcp://localhost:${VECTOR_PORT}"
tag: auth
rest:
depends_on:
analytics:
condition: service_healthy
logging:
driver: syslog
options:
syslog-address: "tcp://localhost:${VECTOR_PORT}"
tag: rest
realtime:
depends_on:
analytics:
condition: service_healthy
logging:
driver: syslog
options:
syslog-address: "tcp://localhost:${VECTOR_PORT}"
tag: realtime
storage:
depends_on:
analytics:
condition: service_healthy
logging:
driver: syslog
options:
syslog-address: "tcp://localhost:${VECTOR_PORT}"
tag: storage
meta:
depends_on:
analytics:
condition: service_healthy
logging:
driver: syslog
options:
syslog-address: "tcp://localhost:${VECTOR_PORT}"
tag: meta
functions:
depends_on:
analytics:
condition: service_healthy
logging:
driver: syslog
options:
syslog-address: "tcp://localhost:${VECTOR_PORT}"
tag: functions
analytics:
container_name: supabase-analytics
image: supabase/logflare:1.0.2
healthcheck:
test: [ "CMD", "curl", "http://localhost:4000/health" ]
timeout: 5s
interval: 5s
retries: 10
restart: unless-stopped
depends_on:
db:
# Disable this if you are using an external Postgres database
condition: service_healthy
ports:
- ${LOGFLARE_HTTP_PORT}:4000/tcp
volumes:
- type: bind
source: ${PWD}/gcloud.json
target: /opt/app/rel/logflare/bin/gcloud.json
read_only: true
environment:
MY_POD_IP: 127.0.0.1
DB_USERNAME: supabase_admin
DB_DATABASE: ${POSTGRES_DB}
DB_HOSTNAME: ${POSTGRES_HOST}
DB_PORT: ${POSTGRES_PORT}
DB_PASSWORD: ${POSTGRES_PASSWORD}
DB_SCHEMA: _analytics
LOGFLARE_API_KEY: ${LOGFLARE_API_KEY}
GOOGLE_PROJECT_ID: ${GOOGLE_PROJECT_ID}
GOOGLE_PROJECT_NUMBER: ${GOOGLE_PROJECT_NUMBER}
LOGFLARE_SINGLE_TENANT: true
LOGFLARE_SUPABASE_MODE: true
LOGFLARE_MIN_CLUSTER_SIZE: 1
vector:
container_name: supabase-vector
image: timberio/vector:0.28.1-alpine
healthcheck:
test:
[
"CMD",
"wget",
"--no-verbose",
"--tries=1",
"--spider",
"http://localhost:${VECTOR_API_PORT}/health"
]
timeout: 5s
interval: 5s
retries: 3
ports:
- ${VECTOR_PORT}:${VECTOR_PORT}
- ${VECTOR_API_PORT}:${VECTOR_API_PORT}
volumes:
- ./volumes/logs/vector.yml:/etc/vector/vector.yml:ro
command: [ "--config", "etc/vector/vector.yml" ]
# Comment out everything below this point if you are using an external Postgres database
db:
logging:
driver: syslog
options:
syslog-address: "tcp://localhost:${VECTOR_PORT}"
tag: db
depends_on:
vector:
# Disable this if you are using an external Postgres database
condition: service_healthy
volumes:
- ./volumes/db/logs.sql:/docker-entrypoint-initdb.d/migrations/99-logs.sql:Z