Replies: 5 comments 2 replies
-
Hail, @oaltun 👋 Welcome to Fief's kingdom! Our team will get back to you very soon to help. In the meantime, take a minute to star our repository ⭐️ Farewell! |
Beta Was this translation helpful? Give feedback.
-
Another consideration is that the "env_file"s are not supported by Docker Swarm Mode. |
Beta Was this translation helpful? Give feedback.
-
Hi @oaltun 👋 That would indeed be an interesting addition! Actually, it seems that Pydantic Settings natively supports Docker Secrets: https://docs.pydantic.dev/latest/usage/settings/#use-case-docker-secrets Thus, the implementation seem quite straightforward! I would be glad to see a PR that try this and see how it goes. |
Beta Was this translation helpful? Give feedback.
-
Nice, I will take a look on this. |
Beta Was this translation helpful? Give feedback.
-
Hi @frankie567, I confirm that Pydantic (^1.10.6) supports Docker secrets. In my own code all I needed to do was to add
in the Pydantic settings class definition. That For each secret XXX, the stack file needs to go like:
There is no need to add XXX_FILE related code, which is a bonus. I added the |
Beta Was this translation helpful? Give feedback.
-
First thank you for this nice auth / user solution. I am trying to replace my current auth code with this, using the Docker image.
One feature I could not find in your image is the support for the Docker secrets.
Docker secrets seem to be the recommended way to pass secret values to images. Widely used images like official Postgresql image support them.
I use Docker Swarm Mode. In that mode instead of a docker-compose file you write a docker stack file. This is similar to a compose file, but different. Compose files also support secrets.
When using Docker secrets, for each secret environment variable XXX, in the Docker stack file we have something like:
and in the fief/settings.py file we would have something like:
We also need to add secret in the command line with a command like
printf "my super secret password" | docker secret create XXX -
I would be happy to work on a pull request if you like this approach.
Beta Was this translation helpful? Give feedback.
All reactions