Skip to content

Commit

Permalink
fix Dockerfile
Browse files Browse the repository at this point in the history
- npm ci を使用するように変更。
- 記法統一

Co-authored-by: InkoHX <[email protected]>
  • Loading branch information
Mogyuchi and InkoHX authored Oct 23, 2023
1 parent 82e20ab commit eeee00a
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@
FROM node:18 AS deps
ARG NODE_ENV=production
WORKDIR /app
COPY ./package*.json .
RUN npm install
COPY ./package*.json ./
RUN npm ci

FROM deps AS builder
FROM node:18 AS builder
ARG NODE_ENV=development
WORKDIR /app
COPY ./build.js ./
COPY ./package*.json ./
RUN npm ci
COPY ./src/ ./src/
RUN npm install
RUN --mount=type=bind,source=build.js,target=build.js \
npm run build
RUN npm run build

FROM gcr.io/distroless/nodejs18-debian12:nonroot AS runner
WORKDIR /app
ENV NODE_ENV=production

COPY --from=builder /app/dist/ ./dist/
COPY ./package.json ./
COPY --from=builder /app/dist/ ./dist/
COPY --from=deps /app/node_modules/ ./node_modules/

CMD ["dist/main.js"]

0 comments on commit eeee00a

Please sign in to comment.