-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove puppeteer dependency when outputting mermaid markdown #176
Comments
Could you share the issue you're having with the puppeteer dependency? I'm not opposed to this at all. It would simplify so many of the issues associated with this project. Removing the dependency would break a lot of existing functionality for others though. Depending on the issue you're having it may be time to split this project off to have a prisma-to-markdown-erd generator |
If you can install puppeteer and you are targeting a |
Hey @keonik ! I'm a colleague of @mo-ayala, so I'll share some more context around the issue we are having. So technically, we don't have an issue per-say with the fact that the package has a dependency on puppeteer. Things work out perfectly, and we just had to configure some other things to make everything work. So in development mode, everything is fine. That being said, when we run our So the reason why we are reaching out here is that we feel like puppeteer is quite a heavy package, and installing it within our production Docker image feels like quite a waste of memory. The alternatives we've considered include things like: running commands to delete the puppeteer node module directory before the image is finished, run a If you have another suggestion, we're all ears. |
I have the same issue. Puppeteer is a beast of a project. Here is an example of what I do to remove package dependencies. It does require a second install and the ###########################################
# build
###########################################
ARG NODE_VERSION=16-alpine
FROM docker.io/node:${NODE_VERSION} as builder
RUN apk update && apk add bash
WORKDIR /usr/src/app
COPY . .
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
# remove and replace unnecessary generators (erd generator)
# Deletes lines 9-12 from prisma/schema.prisma
RUN sed -i '9,12d' prisma/schema.prisma
# install and cache app dependencies
COPY package* /usr/src/app/
RUN npm i --prefer-offline --no-audit --progress=false --silent
# Script to run `prisma generate` only if the prisma folders are missing
RUN scripts/generate.sh
# Package and build app
ENV NODE_ENV production
RUN npm run build
# Remove dev dependencies before we finish build stage
RUN npm ci --omit=dev --no-audit --silent
# rebuild prisma client only if the prisma folders are missing
RUN scripts/generate.sh
# Production image
FROM docker.io/node:${NODE_VERSION} as runner
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nodeuser
USER nodeuser
# add `/app/node_modules/.bin` to $PATH
ENV PATH /usr/src/app/node_modules/.bin:$PATH
WORKDIR /usr/src/app
# Copy needed files for production
COPY --chown=nodeuser:nodejs --from=builder /usr/src/app/node_modules/ ./node_modules/
COPY --chown=nodeuser:nodejs --from=builder /usr/src/app/dist/ ./dist/
COPY --chown=nodeuser:nodejs --from=builder /usr/src/app/prisma/ ./prisma/
COPY --chown=nodeuser:nodejs --from=builder /usr/src/app/package.json ./package.json
# Our app will run on port 3000
EXPOSE 3000
# Stage 2
CMD ["./scripts/start.sh"] |
There is a chance a dbml version of this repository is made on a different branch. TBD. I'm not sure if that one includes puppeteer or not but it was being proposed to support higher fidelity representations initially. |
Hello, we would love to use this plugin, but we are having an issue with the puppeteer dependency needed in order to generate the images, would it be possible to only generate the markdown text without the puppeteer dependency? thanks
The text was updated successfully, but these errors were encountered: