Skip to content

Commit d7ceeb0

Browse files
committed
revert node dockerfile 8 modifications
1 parent e796267 commit d7ceeb0

1 file changed

Lines changed: 5 additions & 17 deletions

File tree

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Pin specific version for stability
22
# Use alpine for reduced image size
3-
FROM node:19.6-alpine AS base
3+
FROM node:19.6-alpine
4+
5+
# Set NODE_ENV
6+
ENV NODE_ENV production
47

58
# Specify working directory other than /
69
WORKDIR /usr/src/app
@@ -9,21 +12,6 @@ WORKDIR /usr/src/app
912
# dependencies (better layer caching)
1013
COPY package*.json ./
1114

12-
FROM base as dev
13-
14-
RUN --mount=type=cache,target=/usr/src/app/.npm \
15-
npm set cache /usr/src/app/.npm && \
16-
npm install
17-
18-
COPY . .
19-
20-
CMD ["npm", "run", "dev"]
21-
22-
FROM base as production
23-
24-
# Set NODE_ENV
25-
ENV NODE_ENV production
26-
2715
# Install only production dependencies
2816
# Use cache mount to speed up install of existing dependencies
2917
RUN --mount=type=cache,target=/usr/src/app/.npm \
@@ -44,4 +32,4 @@ COPY --chown=node:node ./src/ .
4432
# Indicate expected port
4533
EXPOSE 3000
4634

47-
CMD [ "node", "index.js" ]
35+
CMD [ "node", "index.js" ]

0 commit comments

Comments
 (0)