Hi, i am using this docker compose version of keto...
# talk-keto
m
Hi, i am using this docker compose version of keto https://github.com/gen1us2k/ory_workshop/tree/master/keto but when i restart the docker compose for keto evething get lost. i need to configure database for this any guidence on this please
f
In your
keto.yaml
config file you should see a key/value
dsn: memory
. This is saying that the datasource will be in memory. This value is overridden by the env var
DSN
. In order to get Keto to store the relations to a database, you will need a few things: • In your docker-compose file under the keto service you will need the following (but configured for your database):
Copy code
environment:
      - DSN=<postgres://username:password@postgres-database:5432/keto?sslmode=disable>
• You will also need to setup Keto migrate by adding a new entry into your docker-compose using the following (replacing any necessary values for your environment such as network and volumes):
Copy code
keto-migrate:
    container_name: ory-keto-migrate
    depends_on:
      - postgres-database
    image: oryd/keto:v0.8.0-alpha.2
    environment:
      - DSN=<postgres://username:password@postgres-database:5432/keto?sslmode=disable>
      - LOG_LEVEL=trace
    volumes:
      - type: bind
        source: ./keto/config
        target: /etc/config/keto
    command:
      [
        'migrate',
        'up',
        '-c',
        '/etc/config/keto/keto.yml',
        '-y'
      ]
    restart: on-failure
    networks:
      - yournetworkhere
Also worth noting that you’ll need a Postgres (or similar) entry in your docker compose file. I would also suggest upgrading from the example’s
oryd/keto:v0.7.0-alpha.1-sqlite
to something like
oryd/keto:v0.8.0-alpha.2