Skip to content

Commit

Permalink
chore: update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
kyhsa93 committed Nov 13, 2022
1 parent fcd2e4b commit b48ecc5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
26 changes: 9 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
FROM node:gallium-alpine

COPY . /origin

WORKDIR /origin

RUN npm ci && \
npm run build && \
npm prune --production && \
cp -r dist /app && \
cp -r node_modules /app/node_modules && \
rm -rf /origin

FROM node:hydrogen-alpine AS builder
COPY . /app
WORKDIR /app
RUN npm ci && npm run build

FROM node:hydrogen-alpine
COPY --from=builder /app/dist /app
COPY package*.json /app/
WORKDIR /app
RUN npm ci --omit=dev
EXPOSE 5000

USER daemon

CMD ["node", "main.js"]
ENTRYPOINT ["node", "src/main.js"]
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:gallium-alpine
FROM node:hydrogen-alpine
COPY . /app
WORKDIR /app
RUN npm ci
Expand Down

0 comments on commit b48ecc5

Please sign in to comment.