#Docker + Prisma Not reading env

2 messages · Page 1 of 1 (latest)

jade comet
#

Hi, does prisma only read variables from the .env file?
I have a dockerfile and prisma is just ignoring the enviroment variables in the container
they do work when copy my local .env file to the container
otherwise I get this
Imagen
running bunx prisma migrate deploy

#

my dockerfile

FROM oven/bun:latest as base
WORKDIR /usr/src/app

FROM base AS install
ARG NODE_VERSION=20
RUN apt update \
    && apt install -y curl
RUN curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o n \
    && bash n $NODE_VERSION \
    && rm n \
    && npm install -g n

COPY ./package.json ./bun.lockb ./
COPY ./src ./src
COPY ./prisma ./prisma
RUN bun install --production
RUN bunx prisma generate
RUN bunx prisma migrate deploy

FROM base AS release
COPY --from=install /usr/src/app/ .

USER root
EXPOSE 3000/tcp
ENTRYPOINT [ "bun", "src/index.ts" ]