og/Dockerfile
hazycora 990a0f6e8a
Some checks failed
Create and publish a Docker image / build-and-push-image (push) Failing after 1m13s
add trial docker workflow
2023-12-21 10:04:00 -06:00

36 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 ./
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 . .
EXPOSE 8000
CMD ["node", "server.js"]