-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (33 loc) · 1.1 KB
/
Copy pathDockerfile
File metadata and controls
40 lines (33 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM ghcr.io/puppeteer/puppeteer:25.10.0
LABEL maintainer="Jihchi Lee <achi@987.tw>"
# Install system dependencies
USER root
RUN apt-get update \
&& apt-get -yq upgrade \
&& apt-get install -y --no-install-recommends \
fonts-kacst \
fonts-freefont-ttf \
fonts-noto-cjk \
fonts-noto-cjk-extra \
fonts-noto-color-emoji \
fonts-font-awesome \
&& fc-cache -f -v \
&& apt-get autoremove -y \
&& apt-get autoclean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /src/*.deb
USER pptruser
# Set global npm dependencies in the non-root (pptruser) directory
# https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#global-npm-dependencies
ENV NPM_CONFIG_PREFIX=/home/pptruser/.npm-global
ENV PATH=$PATH:/home/pptruser/.npm-global/bin
RUN mkdir -p /home/pptruser/.npm-global/bin
# Install package manager
RUN corepack enable --install-directory /home/pptruser/.npm-global/bin
# pnpm fetch does require only lockfile
COPY package.json pnpm-lock.yaml ./
RUN pnpm fetch --prod
COPY --chown=pptruser:pptruser . ./
RUN pnpm install -r --offline --prod
CMD ["pnpm", "start"]
EXPOSE 3000