og/Dockerfile

40 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"
RUN pnpm install --prod
COPY --chown=og:og . .
2024-05-22 23:58:52 -04:00
RUN pnpm run build
2024-05-22 23:47:15 -04:00
EXPOSE 8000
CMD ["pnpm", "run", "start"]