faint-bear-71759
11/28/2024, 11:15 AMservices:
keto-migrate:
build: ./ory/keto
environment:
- LOG_LEVEL=debug
- DSN=sqlite:///var/lib/sqlite/db.sqlite?_fk=true&mode=rwc
command: -c /home/ory/keto.yml migrate up -y
restart: on-failure
volumes:
- type: volume
source: keto-sqlite
target: /var/lib/sqlite
read_only: false
keto:
build: ./ory/keto
depends_on:
- keto-migrate
environment:
- DSN=sqlite:///var/lib/sqlite/db.sqlite?_fk=true
command: serve -c /home/ory/keto.yml
restart: on-failure
volumes:
- type: volume
source: keto-sqlite
target: /var/lib/sqlite
read_only: false
volumes:
keto-sqlite:
brief-egg-61061
11/28/2024, 11:15 AMbrief-egg-61061
11/28/2024, 11:16 AMketo-sqlite
mounted at /var/lib/sqlite
. Make sure this volume is properly created and has the correct permissions. 3. To ensure the directory exists and has the right permissions, you can modify your Docker Compose file to create the directory before running Keto. Add a new service to create the directory: yaml services: init: image: busybox volumes: - keto-sqlite:/var/lib/sqlite command: mkdir -p /var/lib/sqlite keto-migrate: depends_on: - init # ... rest of your keto-migrate configuration keto: depends_on: - init - keto-migrate # ... rest of your keto configuration
4. Make sure the DSN
environment variable is correctly set. The [Ory deployment documentation](https://www.ory.sh/docs/ecosystem/deployment) suggests using the following format for SQLite: yaml environment: - DSN=sqlite:///var/lib/sqlite/db.sqlite?_fk=true&mode=rwc
5. If you're still encountering issues, you might want to check if SELinux is enabled on your system. If it is, you may need to use a different Docker Compose file as mentioned in the [Kratos quickstart guide](https://www.ory.sh/docs/kratos/quickstart#clone-ory-kratos-and-run-it-in-docker): docker-compose -f quickstart.yml -f quickstart-selinux.yml -f quickstart-standalone.yml up --build --force-recreate
6. Lastly, ensure that you've run the necessary migrations. The [Keto migration documentation](https://www.ory.sh/docs/keto/cli/keto-migrate-up) suggests running: keto migrate up
This command is included in your keto-migrate
service, but make sure it completes successfully before the keto
service starts. If you're still experiencing issues after trying these steps, you might want to check the Keto logs for more detailed error messages. If the problem persists, consider reaching out to the Ory community on their [Slack channel](https://www.ory.sh/docs/ecosystem/contributing#ide-tips) for further assistance.faint-bear-71759
11/28/2024, 12:49 PMory
user:
FROM oryd/keto:v0.12.0-alpha.0
# By creating the sqlite folder as the ory user, the mounted volume will be owned by ory:ory, which
# is required for read/write of SQLite.
USER root
RUN mkdir -p /var/lib/sqlite
RUN chown ory:ory /var/lib/sqlite
VOLUME /var/lib/sqlite
USER ory