Deploy NexusJS with fully abstracted reflection system

I’m trying to deploy NexusJS with a Fully abstracted reflection system. (which means the application needs to be ruined to generate TS Values).

So, there are 2 ways suggested. I tried both but while running

"nexus:reflect": "NEXUS_SHOULD_EXIT_AFTER_REFLECTION=true ts-node-dev src", from docker file

RUN --mount=type=secret,id=_env,dst=/etc/secrets/.env cat /etc/secrets/.env
RUN apt-get update
RUN apt-get install -y openssl
RUN yarn
RUN yarn db:generate
RUN yarn build
RUN yarn nexus:reflect

Prisma client is not able to find ENV variable. That’s how it looks like inside of prisma file:

url = env(“DATABASE_URL”)
shadowDatabaseUrl = env(“SHADOW_DATABASE_URL”)

any ideas how to solve this?

Hi there,

Thanks for reaching out.

I think the issue here is that you’re not extracting any details from the secret file to the environment you’re just cating it. Our secrets example is based on Docker’s own which only displays the contents of the file with cat. You’d likely need to export your details to the environment, depending on the contents of your file, something as simple as:

RUN --mount=type=secret,id=_env,dst=/etc/secrets/.env export $(egrep -v '^#' /etc/secrets/.env | xargs)

Hope that helps


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.