hey all im trying to setup prisma server using doc...
# orm-help
j
hey all im trying to setup prisma server using docker stack, and i want to use secrets for the configuration. It's not clear if/how I can do that, the configuration yaml seems to be passed as an environment variable. Is there a way I can have it use a file instead?
d
Can you please point out to the docs you are referring to? Are you referring to Prisma.yml to have configuration via file?
You can specify secrets in a .env file that will be picked up by Prisma CLI
what would i call the env file / how would i specify it for prisma to check at startup?
oh prisma cli, i need this for the server, i think
d
You want to set docker variables via file? When setting up Prisma?
j
that's how Docker propagates secrets, it creates files in
/run/secrets/
so putting them in environment variables is tricky
d
I am not clear on which environment variable you want to set yet.. can you please elaborate by an example? 🙂 Generally, both
prisma.yml
and
docker-compose.yml
files support .env files https://docs.docker.com/compose/env-file/
j
I'm trying to set
PRISMA_CONFIG
from a secrets file.
I suppose I could use the
prisma.yml
file but I have no idea where it's supposed to go or how I can specify its location because the prisma documentation only talks about setting this
PRISMA_CONFIG
env variable
d
Yes, then you should be able to use the .env file as per the
docker-compose.yml
documentation! => https://docs.docker.com/compose/env-file/#syntax-rules
j
i do not believe this solves the problem, this is effectively the same as declaring the env variables in the compose.yml file. The secrets are inside the container, mounted by the docker process.
d
Aha! Got it. You want to not have the secrets in container at all. There are ways to do that, will get back with some resources!
j
no no, the secrets are in the container (mounted by the docker process)...but they are files, so i want to be able to load the config from a file somehow. For example with postgres you can do
POSTGRES_USER_FILE: /run/secrets/postgres_user
as an environment variable in the docker-compose.yml and it will slurp the contents of the file and use that as the POSTGRES_USER env variable.
d
Aha! got it.. I am afraid this is not supported yet, can you please create a feature request for this? Thanks!
j
hm, i think you guys may actually support it already. I just found this while digging through the code; PRISMA_CONFIG_PATH
d
Interesting, can you please point me out to a resolution? I will persist that for future queries.
please let me know if you think im reading that wrong, so far i still havent quite gotten it to work but that could be an unrelated problem
d
Thanks for the details! I will get back to you on this after communicating internally! 👍