Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improves postgres example #21

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions datastores/postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@
#
# SpiceDB settings:
# pre-shared key: foobar
# dashboard address: http://localhost:8080
# metrics address: http://localhost:9090
# grpc address: http://localhost:50051
# grpc address: localhost:50051
#
# Postgres settings:
# user: postgres
# password: secret
# port: 5432
#
# example call with zed:
# zed schema read --endpoint=localhost:50051 --insecure=true

version: "3"

Expand Down Expand Up @@ -46,9 +48,20 @@ services:
- "database"

database:
image: "postgres"
image: "postgres:15"
ports:
- "5432:5432"
environment:
- "POSTGRES_PASSWORD=secret"
- "POSTGRES_DB=spicedb"

# track_commit_timestamp is required to support SpiceDB's Watch API
# see https://authzed.com/docs/spicedb/concepts/datastores#usage-notes-2
init_database:
vroldanbet marked this conversation as resolved.
Show resolved Hide resolved
image: "postgres:15"
restart: "on-failure:3"
command: "psql -h database -U postgres -c \"ALTER SYSTEM SET track_commit_timestamp = on;\""
environment:
- "PGPASSWORD=secret"
depends_on:
- "database"
Loading