revert node dockerfile 8 modifications
This commit is contained in:
@ -1,6 +1,9 @@
|
|||||||
# Pin specific version for stability
|
# Pin specific version for stability
|
||||||
# Use alpine for reduced image size
|
# Use alpine for reduced image size
|
||||||
FROM node:19.6-alpine AS base
|
FROM node:19.6-alpine
|
||||||
|
|
||||||
|
# Set NODE_ENV
|
||||||
|
ENV NODE_ENV production
|
||||||
|
|
||||||
# Specify working directory other than /
|
# Specify working directory other than /
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
@ -9,21 +12,6 @@ WORKDIR /usr/src/app
|
|||||||
# dependencies (better layer caching)
|
# dependencies (better layer caching)
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
FROM base as dev
|
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/usr/src/app/.npm \
|
|
||||||
npm set cache /usr/src/app/.npm && \
|
|
||||||
npm install
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
CMD ["npm", "run", "dev"]
|
|
||||||
|
|
||||||
FROM base as production
|
|
||||||
|
|
||||||
# Set NODE_ENV
|
|
||||||
ENV NODE_ENV production
|
|
||||||
|
|
||||||
# Install only production dependencies
|
# Install only production dependencies
|
||||||
# Use cache mount to speed up install of existing dependencies
|
# Use cache mount to speed up install of existing dependencies
|
||||||
RUN --mount=type=cache,target=/usr/src/app/.npm \
|
RUN --mount=type=cache,target=/usr/src/app/.npm \
|
||||||
|
|||||||
Reference in New Issue
Block a user