Skip to content
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

refactor: optimize dockerfile for AsyncAPI generator setup #1286

Closed
wants to merge 9 commits into from
18 changes: 8 additions & 10 deletions apps/generator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
ARG ASYNCAPI_GENERATOR_VERSION=1.10.9

FROM node:18-alpine

ARG ASYNCAPI_GENERATOR_VERSION="1.10.9" # Include ARG in the build stage and surround it with double quotes

Copy link
Contributor

Choose a reason for hiding this comment

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

Pls. remove these unwanted comments

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
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.
RUN apk --update add git chromium && \
rm -rf /var/lib/apt/lists/* && \
rm /var/cache/apk/*

# Installing latest released npm package
RUN npm install -g @asyncapi/generator@$ASYNCAPI_GENERATOR_VERSION
RUN apk --update add --no-cache git chromium && \
npm install -g @asyncapi/generator@"$ASYNCAPI_GENERATOR_VERSION" && \ # Surround variable with double quotes
npm cache clean --force
Copy link
Contributor

Choose a reason for hiding this comment

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

From here also, pls. remove extra commnets


# Define the entry point for the AsyncAPI generator
ENTRYPOINT [ "ag" ]
Loading