SpiceDB docker-compose example
# spicedb
y
https://github.com/yordis/.dotfiles/blob/56fcd0632eec1bfe06c2c1a4adf2d639360a3c19/roles/docker/src/docker-compose.yml#L422-L452 that is not workig per se. I am not sure how the task of migrating the DB to create the tables and whatnot suppose to work. I know the issue I am facing right now, but I just dont know what should be THE WAY I suppose to be doing this
Copy code
spicedb  | {"level":"error","error":"failed to create datastore: unable to instantiate datastore: failed to connect to `host=postgresql user=postgres database=spicedb`: server error (FATAL: database \"spicedb\" does not exist (SQLSTATE 3D000))","time":"2023-08-24T22:36:11Z","message":"terminated with errors"}
y
@vroldanbet is there any
migrate db.create
or something?
v
What do you mean?
y
so I do not have to go to a console or something to create the DB
Copy code
yaml
  spicedb-migrate:
    image: authzed/spicedb:latest
    command:
      - migrate create
      - migrate head
v
No. We've left Creating a database outside of the migration flow - it requires higher administrative privileges. The assumption is a database and corresponding credentials have been provisioned and used by the migrate command
If for testing purposes, you can: - use the memory datastore - use serve-testing command - use the SpiceDB GitHub Action to provision a SpiceDB for you in your Actions pipeline
The postgres container may also have ways to provision a container and user on bootstrap.
And another option is using the default db and credentials it comes with
y
Wait, I am not proposing to add it to the migrate command by that, definitely a Ops concern that I wouldn't like the app to worry about
That
ecto.create
is there, for the most part, for local dev or things like that
Hold on, I am fixing the situation to some extent, documentation is enough sometimes 😉
Nevermind, I guess your example is fine if I used it, but since I copied the files I ignored the DB part since I had one already ...
Tricky, either I can update the docs to include "hey pay attention, you may need to provision the db yourself" or whatever, you live you learn
v
Let's take a step back, what are you trying to achieve at a high level, create a dev environment? Could you share more details?
y
It is just a personal dotfiles I have, and the company dotfiles
Run the services required using docker compose
https://github.com/yordis/.dotfiles/tree/master/roles/docker/src that is the personal dotfiles, I have another one for the Org really similar to that one
Just be able to run the services for local development