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

Add option for using docker volume for data persistence #471

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

m-danya
Copy link

@m-danya m-danya commented Oct 13, 2024

Motivation

Current docs provide two types of using Fief in projects:

  1. Local setup: single docker container
  2. Production setup with reverse proxy and SSL setup

I think it will be useful to add --use-docker-volume option to quickstart command to provide complete command for local setup with persistence. Currently, the data is stored inside the container without using volumes, and while it technically will persist across container restart, using volume is more reliable way to persist data (e.g. across rebuilding Fief image).

I believe persistence can be useful in local setup.

Docs improvements

If this PR will be accepted, the docs also should be edited to highlight this option. In fact, the docs now contain a bit of misleading information, as current setup doesn't persist data during container rebuilds:

If you need to restart or recreate your container, you'll need to set the same secrets again.

Also, the default value for DATABASE_LOCATION in https://docs.fief.dev/self-hosting/environment-variables/ is stated is "Current working directory", while it's actually /data/db for Docker setup

@frankie567
Copy link
Member

That's a super helpful suggestion, @m-danya, thanks 🙏 I'm even thinking it should be True by default. What do you think?

@m-danya
Copy link
Author

m-danya commented Oct 19, 2024

@frankie567 Hi, thanks! Yes, that seems reasonable to me.

@m-danya
Copy link
Author

m-danya commented Oct 19, 2024

The mypy check fails with this:

cmd [3] | mypy fief/
fief/dependencies/fief.py:18: error: Item "None" of "Coroutine[Any, Any, Any] | None" has no attribute "cr_frame"  [union-attr]

Since I'm not in the context of what's going on in this file, could you please fix the tests? I've got "Allowing edits by maintainers" checked on this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants