1- FROM node:22.16 -alpine AS builder
1+ FROM node:24.11 -alpine AS builder
22
33COPY . /app
44
55WORKDIR /app
66
7- RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev
7+ RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts
88
99RUN --mount=type=cache,target=/root/.npm npm run build
1010
1111# --- Release Stage ---
12- FROM node:22-alpine AS release
12+ FROM node:24-alpine AS release
13+
14+ # Install necessary tools and base fonts
15+ RUN apk add --no-cache \
16+ fontconfig \
17+ font-noto-cjk \
18+ ttf-freefont \
19+ curl \
20+ unzip \
21+ chromium \
22+ nss
23+
24+ # Download and install Japanese fonts from GitHub
25+ RUN mkdir -p /usr/share/fonts/truetype/google && \
26+ # Noto Sans JP from GitHub
27+ curl -L "https://github.com/googlefonts/noto-cjk/raw/main/Sans/OTF/Japanese/NotoSansJP-Regular.otf" -o /usr/share/fonts/truetype/google/NotoSansJP-Regular.otf && \
28+ curl -L "https://github.com/googlefonts/noto-cjk/raw/main/Sans/OTF/Japanese/NotoSansJP-Bold.otf" -o /usr/share/fonts/truetype/google/NotoSansJP-Bold.otf && \
29+ # IPAex Gothic font as fallback
30+ curl -L "https://moji.or.jp/wp-content/ipafont/IPAexfont/IPAexfont00401.zip" -o ipaex.zip && \
31+ unzip ipaex.zip && \
32+ cp IPAexfont00401/*.ttf /usr/share/fonts/truetype/google/ && \
33+ rm -rf IPAexfont00401 ipaex.zip
34+
35+ # Update font cache
36+ RUN fc-cache -f -v
37+
38+ # Set Puppeteer to use system Chromium
39+ ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
1340
1441# Set up a non-root user ('appuser'/'appgroup') to avoid running as root - good security practice!
1542# (-S is the Alpine option for a system user/group, suitable here)
@@ -19,7 +46,7 @@ RUN addgroup -S appgroup && adduser -S appuser -G appgroup
1946COPY --from=builder /app/dist /app/dist
2047COPY --from=builder /app/package.json /app/package.json
2148COPY --from=builder /app/package-lock.json /app/package-lock.json
22- COPY --from=builder /app/richmenu-templates /app/richmenu-templates
49+ COPY --from=builder /app/richmenu-template /app/richmenu-templates
2350
2451ENV NODE_ENV=production
2552
@@ -30,7 +57,7 @@ WORKDIR /app
3057RUN chown -R appuser:appgroup /app
3158
3259# Install *only* the production dependencies
33- RUN npm ci --ignore-scripts --omit- dev
60+ RUN npm ci --ignore-scripts --omit= dev
3461
3562RUN apk add --no-cache chromium nss freetype harfbuzz ca-certificates ttf-freefont
3663
0 commit comments