41 lines
1.1 KiB
Docker
41 lines
1.1 KiB
Docker
FROM node:slim AS app
|
|
|
|
# Install Google Chrome Stable and fonts
|
|
# Note: this installs the necessary libs to make the browser work with Puppeteer.
|
|
RUN apt-get update && apt-get install gnupg wget -y \
|
|
&& wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg \
|
|
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
|
|
&& apt-get update \
|
|
&& apt-get install google-chrome-stable -y --no-install-recommends \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN groupadd -r og && useradd -rm -g og -G audio,video og
|
|
|
|
RUN mkdir -p /home/og/app/node_modules && chown -R og:og /home/og/app
|
|
|
|
WORKDIR /home/og/app
|
|
|
|
COPY package*.json ./
|
|
|
|
COPY fonts /usr/local/share/fonts
|
|
|
|
ENV PNPM_HOME="/pnpm"
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
RUN corepack enable
|
|
|
|
USER og
|
|
|
|
# We don't need the standalone Chromium
|
|
ENV PUPPETEER_SKIP_DOWNLOAD true
|
|
ENV PUPPETEER_EXECUTABLE_PATH "/usr/bin/google-chrome-stable"
|
|
|
|
COPY --chown=og:og . .
|
|
|
|
RUN pnpm install
|
|
|
|
RUN pnpm run build
|
|
|
|
EXPOSE 9054
|
|
|
|
CMD ["pnpm", "run", "start"]
|