Skip to content

Commit

Permalink
Allow mounting SQLite in /home/ory/sqlite (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr authored Jan 31, 2020
1 parent 2e43ec0 commit 2fe8c0f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
10 changes: 9 additions & 1 deletion .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
FROM alpine:3.11

RUN addgroup -S ory; \
adduser -S ory -G ory -D -H -s /bin/nologin
adduser -S ory -G ory -D -h /home/ory -s /bin/nologin; \
chown -R ory:ory /home/ory
RUN apk add -U --no-cache ca-certificates

WORKDIR /home/ory

# These are neccessary for mounting SQLITE volumes which require WRITE permission.
RUN mkdir -p /home/ory/sqlite; \
chown ory:ory /home/ory/sqlite
VOLUME /home/ory/sqlite

COPY kratos /usr/bin/kratos

USER ory
Expand Down
16 changes: 9 additions & 7 deletions quickstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ services:
kratos-migrate:
image: oryd/kratos:latest-sqlite
environment:
- DSN=sqlite:///var/lib/sqlite/db.sqlite?_fk=true
- DSN=sqlite:///home/ory/sqlite/db.sqlite?_fk=true
volumes:
-
type: volume
source: kratos-sqlite
target: /var/lib/sqlite/
target: /home/ory/sqlite
read_only: false
-
type: bind
Expand Down Expand Up @@ -70,11 +70,15 @@ services:
- "4434:4434" # admin
restart: unless-stopped
environment:
- DSN=sqlite:///var/lib/sqlite/db.sqlite?_fk=true
- DSN=sqlite:///home/ory/sqlite/db.sqlite?_fk=true
command:
serve -c /etc/config/kratos/.kratos.yml --dev
volumes:
- kratos-sqlite:/var/lib/sqlite/
-
type: volume
source: kratos-sqlite
target: /home/ory/sqlite
read_only: false
-
type: bind
source: ./contrib/quickstart/kratos/email-password
Expand All @@ -93,6 +97,4 @@ networks:
intranet:

volumes:
kratos-sqlite:
kratos-config:
oathkeeper-config:
kratos-sqlite:

0 comments on commit 2fe8c0f

Please sign in to comment.