og/Dockerfile

41 lines
1.1 KiB
Docker
Raw Normal View History

2024-05-22 23:47:15 -04:00
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 . .
2024-05-23 00:00:04 -04:00
RUN pnpm install
2024-05-22 23:58:52 -04:00
RUN pnpm run build
2024-06-03 23:27:10 -04:00
EXPOSE 9054
2024-05-22 23:47:15 -04:00
2024-06-03 23:27:10 -04:00
CMD ["pnpm", "run", "start"]