add trial docker workflow
This commit is contained in:
parent
0c423c11da
commit
990a0f6e8a
3 changed files with 90 additions and 0 deletions
36
Dockerfile
Normal file
36
Dockerfile
Normal file
|
@ -0,0 +1,36 @@
|
|||
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"]
|
Loading…
Add table
Add a link
Reference in a new issue