Skip to content

Commit ed50240

Browse files
committed
update dockerfile
1 parent 05c854a commit ed50240

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ jobs:
2525
with:
2626
node-version: ${{ matrix.node-version }}
2727
- run: npm ci
28+
- run: npm run build
2829
- run: npm run test

Dockerfile

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
FROM alpine
1+
FROM node:22-bookworm-slim
22

3-
RUN apk add --no-cache \
4-
chromium \
5-
nss \
6-
freetype \
7-
harfbuzz \
8-
ca-certificates \
9-
ttf-freefont \
10-
nodejs \
11-
npm
12-
13-
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
5+
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
146
ENV HTML2PDF_NO_SANDBOX=true
157

8+
RUN apt-get update && \
9+
apt-get install -y wget gnupg && \
10+
apt-get install -y fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
11+
libgtk2.0-0 libnss3 libatk-bridge2.0-0 libdrm2 libxkbcommon0 libgbm1 libasound2 && \
12+
apt-get install -y chromium && \
13+
apt-get clean
14+
1615
WORKDIR /app
17-
COPY ["package.json", "./"]
16+
EXPOSE 3000
17+
18+
COPY package.json .
19+
COPY package-lock.json .
1820
RUN npm install
21+
1922
COPY . .
20-
CMD ["npm", "start"]
23+
RUN npm run clean
24+
RUN npm run build
25+
26+
CMD ["npm", "run", "start"]

0 commit comments

Comments
 (0)