Files
supabase/docker/docker-compose-logging.yml

164 lines
4.3 KiB
YAML

# 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.3.17
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