Files
supabase/docker/docker-compose-logging.yml
2023-04-04 02:09:10 +01:00

156 lines
3.9 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
version: "3.8"
services:
studio:
logging:
driver: syslog
options:
syslog-address: "tcp://localhost:${VECTOR_PORT}"
tag: studio
depends_on:
logs:
condition: service_healthy
environment:
LOGFLARE_API_KEY: ${LOGFLARE_API_KEY}
LOGFLARE_URL: http://logs:4000
NEXT_PUBLIC_ENABLE_LOGS: true
kong:
depends_on:
logs:
condition: service_healthy
auth:
depends_on:
logs:
condition: service_healthy
logging:
driver: syslog
options:
syslog-address: "tcp://localhost:${VECTOR_PORT}"
tag: auth
rest:
depends_on:
logs:
condition: service_healthy
logging:
driver: syslog
options:
syslog-address: "tcp://localhost:${VECTOR_PORT}"
tag: rest
realtime:
depends_on:
logs:
condition: service_healthy
logging:
driver: syslog
options:
syslog-address: "tcp://localhost:${VECTOR_PORT}"
tag: realtime
storage:
depends_on:
logs:
condition: service_healthy
logging:
driver: syslog
options:
syslog-address: "tcp://localhost:${VECTOR_PORT}"
tag: storage
meta:
depends_on:
logs:
condition: service_healthy
logging:
driver: syslog
options:
syslog-address: "tcp://localhost:${VECTOR_PORT}"
tag: meta
logs:
container_name: supabase-logs
image: supabase/logflare:1.0.0
healthcheck:
test:
[
"CMD",
"wget",
"--no-verbose",
"--tries=1",
"--spider",
"http://localhost:4000/health"
]
timeout: 5s
interval: 5s
retries: 3
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:
PHX_STATIC: PATH=/opt/app/rel/logflare/bin/priv/static
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_NAME: ${POSTGRES_DB}
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:9001/health"
]
timeout: 5s
interval: 5s
retries: 3
ports:
- ${VECTOR_PORT}:${VECTOR_PORT}
- ${VECTOR_API_PORT}:${VECTOR_API_PORT}
volumes:
- $PWD/vector.yaml:/etc/vector/vector.yaml:ro
command: [ "--config", "etc/vector/vector.yaml" ]
# 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