Skip to content

chore(docker): improve Dockerfile for smaller image and better PDF support #1475

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions apps/generator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@ ARG ASYNCAPI_GENERATOR_VERSION=1.10.9

WORKDIR /app

# Since 0.14.0 release of html-template chromium is needed for pdf generation
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true

# Since 0.30.0 release Git is supported and required as a dependency
# Since 0.14.0 release of html-template chromium is needed for pdf generation.
# More custom packages for specific template should not be added to this dockerfile. Instead, we should come up with some extensibility solution.
# Installing latest released npm package
RUN apk --update add git chromium && \
rm /var/cache/apk/* && \
# Install git, chromium, and required libs
RUN apk add --no-cache \
git \
chromium \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @Hemanthbugata any relevant links or screenshots or docs from where you have taken the reference of these packages to be installed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nss \
freetype \
harfbuzz \
ca-certificates \
ttf-freefont && \
npm install --ignore-scripts -g "@asyncapi/generator@${ASYNCAPI_GENERATOR_VERSION}"

ENTRYPOINT ["ag"]
CMD ["--help"]

ENTRYPOINT [ "ag" ]
Loading