I am trying to pass some Prisma config as environm...
# orm-help
a
I am trying to pass some Prisma config as environment variable PRISMA_CONFIG when I start my Docker container (see image). Can’t get my head around why I am getting the following parse error: “Unable to load Prisma config: mapping values are not allowed here”. Any ideas?
n
Probably wrong identation or hierarchy in your config file. Can you share it?
Ah I see you are passing it inline
a
Copy code
port: 4466
  databases:
    default:
      connector: postgres
      host: postgres
      port: 5432
      user: prisma
      password: prisma
      migrations: true
n
I think you are missing some spaces before
connector
a
this is the content I used as a base
hmm..
a
Thanks, ended up in that post a couple of times while googling.. That is when using a yml file and not passing it as an inline variable - right?
d
I don’t know off the top of my head if the yml parser in prisma also recognizes tabs, but you can try by just replacing the space identation with \t (to rule out identation issues)
a
@dpetrick thanks but still getting the same error
with \t
d
Looking closer, docker -e has some issues iirc to pass escaped string sequences correctly to the container. I remember that there was an issue somewhere.
if you really need
docker run
I would recommend you mount the config file into the container and pass the
PRISMA_CONFIG_PATH
variable instead, pointing to the mount path. I know it’s not really an ideal, easy solution, but at least that should work. Else I recommend just using docker compose.
a
Ah, I see… Will try that! Was looking into that alternative a couple of hours ago. Thank you!
n
@Anton, this looks like an open feature request to me. Or did you actually use this parameter to make it work? What's the new command that you use?
a
Correct.. I accidentally linked to a specific comment. My intention was to link to the issue in general. I tried the parameter but it didn’t work either… So, no solution yet.
😞 1
Not a blocker for me currently though… I was just interested in testing it
👍 2
a
@nilan Thanks! Will try that out when I have time but looks promising for sure 🙂
👍 1