Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Dockerfile #1

Merged
merged 2 commits into from
Oct 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
FROM node:18 as builder
# syntax=docker/dockerfile:1

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

COPY ./* ./

RUN npm install
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 run build

FROM node:18-alpine as runner

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

COPY --from=builder /app/dist/main.js ./dist
COPY ./package.json ./

RUN npm install

CMD ["node", "main.js"]
COPY --from=builder /app/dist/ ./dist/
COPY --from=deps /app/node_modules/ ./node_modules/
cm-ayf marked this conversation as resolved.
Show resolved Hide resolved
CMD ["dist/main.js"]