Skip to content

Commit

Permalink
build: update node to v20 (#26)
Browse files Browse the repository at this point in the history
Closes #18 

Release-As: 0.1.1

debian 12を採用していることによりopusのprebuildが利用できていないため,実はNode
20に上げても上げなくてもopusのビルドは走っていたようです.

なお,`20.10.0`ではなく`20.10.0-bookworm`としたのは,depsステージでもdebian
12を使わせるためです.現在は最新版がbookwormなので違いはありませんが,今後新しいバージョンが出てきたときに壊れないよう,bookwormに固定します.
  • Loading branch information
femshima authored Dec 12, 2023
1 parent feee0f4 commit ef3a636
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: npm
- name: Install dependencies
run: npm install
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# syntax=docker/dockerfile:1

FROM node:18.19.0 AS deps
FROM node:20.10.0-bookworm AS deps
ARG NODE_ENV=production
WORKDIR /app
COPY ./package*.json ./
RUN npm ci

FROM --platform=$BUILDPLATFORM node:18.19.0 AS builder
FROM --platform=$BUILDPLATFORM node:20.10.0-bookworm AS builder
ARG NODE_ENV=development
WORKDIR /app
COPY ./build.js ./
Expand All @@ -15,7 +15,7 @@ RUN npm ci
COPY ./src/ ./src/
RUN npm run build

FROM --platform=$BUILDPLATFORM node:18 AS model-fetch
FROM --platform=$BUILDPLATFORM node:20.10.0-bookworm AS model-fetch

WORKDIR /app
RUN wget https://github.com/jpreprocess/jpreprocess/releases/download/v0.6.1/naist-jdic-jpreprocess.tar.gz \
Expand All @@ -25,7 +25,7 @@ RUN wget http://downloads.sourceforge.net/open-jtalk/hts_voice_nitech_jp_atr503_
&& tar xzf hts_voice_nitech_jp_atr503_m001-1.05.tar.gz \
&& rm hts_voice_nitech_jp_atr503_m001-1.05.tar.gz

FROM gcr.io/distroless/nodejs18-debian12:nonroot AS runner
FROM gcr.io/distroless/nodejs20-debian12:nonroot AS runner
WORKDIR /app
ENV NODE_ENV=production
COPY ./package.json ./
Expand Down
16 changes: 12 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"author": "Discord.js Japan User Group (discordjs-japan.org)",
"license": "MIT",
"devDependencies": {
"@types/node": "18",
"@types/node": "20",
"@typescript-eslint/eslint-plugin": "^6.7.5",
"@typescript-eslint/parser": "^6.7.5",
"dotenv": "^16.3.1",
Expand Down

0 comments on commit ef3a636

Please sign in to comment.