Simão Cruz
06/25/2021, 12:20 PMError: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.
I already made "prisma generate" command successfully in my dockerfile. How I can solve this? ThanksRyan
06/25/2021, 12:21 PMDockerfile
? Also are you generating @prisma/client
in a different location?Simão Cruz
06/25/2021, 1:03 PMFROM node:14.16.0
# for caching optimisations
COPY package*.json /
COPY .babelrc /
RUN npm install --silent
RUN npm install -g prisma @prisma/client babel-cli
COPY ./prisma /prisma
COPY ./src /src
ENV PORT="8850"
ENV HOST="<http://localhost:8850>"
ENV DB="mybd"
ENV DBSCHEMA="public"
ENV DBUSER="prisma"
ENV DBPASSWORD="#####"
ENV DBSECRET="#####"
ENV DATABASE_URL="#####"
RUN prisma generate
RUN npm run build
ADD sayhello /sayhello
RUN chmod +x /sayhello
EXPOSE 8850
WORKDIR /
# wait for postgres init
ENV WAIT_VERSION 2.7.2
ADD <https://github.com/ufoscout/docker-compose-wait/releases/download/$WAIT_VERSION/wait> /wait
RUN chmod +x /wait
CMD ["/sayhello", "&&", "npm", "run", "start"]
Simão Cruz
06/25/2021, 1:04 PMecho prisma generate && prisma migrate dev -n init --preview-feature
Simão Cruz
06/25/2021, 1:07 PMRyan
06/25/2021, 2:09 PMnpm install
after copying the prisma
folder and also if you have a local installation of @prisma/client
and prisma
then this line is not needed:
npm install -g prisma @prisma/client
This part can be removed.Ryan
06/25/2021, 2:09 PMBefore run my dockerfile, I’ve started prisma and postgres imagesI didn’t understand what you mean by prisma image?
Simão Cruz
06/25/2021, 2:59 PM