You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please add more details about when we have seeds. Personally I did this: Dockerfile
# As you understood I have another base.Dockerfile to do npm ci and commit it as my base image. I did this because in my area Net bother me a lot and my image build time was around 20 min and mostly failed due to Socket timeout error while npm ci# FROM node:16.14.0-alpine3.15 as build_stageFROM take-report:dep as build_stage
# README: Because WORKDIR is set in the take-report:dep I ignore to use it here again# WORKDIR /app# When using COPY with more than one source file, the destination must be a directory and end with a /COPY prisma ./prisma/
COPY . .
RUN npx prisma generate
RUN npm run build
# RUN npm prune --productionFROM node:16.14.0-alpine3.15
WORKDIR /app
COPY --from=build_stage /app/node_modules ./node_modules
COPY --from=build_stage /app/package*.json ./
COPY --from=build_stage /app/tsconfig*.json ./
COPY --from=build_stage /app/dist ./dist
COPY --from=build_stage /app/prisma ./prisma
EXPOSE $APP_PORT
@Furkan-Gulsen It is elementary, Did you have the prisma installed as a dev Dependency? if not do this npm i -D prisma.
Then it should work.
The other options is to install prisma globally before the RUN npx prisma generate. But please note that I used to use a custom images. My base.Dockerfile for the take-report:dep is this:
# Just because of too many socket timeout and bottleneck while installing 3rd party packages I did this.FROM node:16.14.0-alpine3.15
WORKDIR /app
# When using COPY with more than one source file, the destination must be a directory and end with a /COPY package*.json ./
RUN NODE_ENV=development npm ci
And eventually I docker build . -f base.Dockerfile -t take-report:dep. I hope this helps you
Please add more details about when we have seeds. Personally I did this:
Dockerfile
And this is my
docker-compose.yml
file:And in my
package.json
I have these scripts:But my problem with this solution is that I have to run
npm prune --production
after my seed completed. Do you have any idea to improve this?The text was updated successfully, but these errors were encountered: