Add the npm ci instead

This commit is contained in:
2025-10-31 17:11:34 +07:00
parent 98b84a92e1
commit 39924f45c5

View File

@@ -4,24 +4,25 @@ FROM node:22.14.0-alpine
# Set the working directory in the container # Set the working directory in the container
WORKDIR /app WORKDIR /app
# COPY package*.json ./ # Copy package.json and package-lock.json (if you want to use the lock file)
COPY /src/Managing.Web3Proxy/package.json ./ # If your local lock file is platform-specific, add 'package-lock.json' to .dockerignore
COPY src/Managing.Web3Proxy/package*.json ./
# Declaring env # Declaring env
ENV NODE_ENV production ENV NODE_ENV production
# Bust cache and fully reinstall deps and lockfile each build # Install dependencies in the correct environment
ARG BUILD_TIMESTAMP # We remove the "npm install --package-lock-only" step.
RUN echo "CACHEBUST=$BUILD_TIMESTAMP" \ # "npm ci" requires a lock file, "npm install" will generate one if absent.
&& rm -rf node_modules package-lock.json \ RUN npm ci --no-audit --fund=false
&& npm install --package-lock-only \ # If you don't have a local package-lock.json or are ignoring it, use "npm install" instead of "npm ci"
&& npm ci --no-audit --fund=false
# Copy the rest of the application source code
COPY src/Managing.Web3Proxy/ . COPY src/Managing.Web3Proxy/ .
# Build the app # Build the app (if 'build' script involves TS compilation, it should be fine here)
RUN npm run build RUN npm run build
EXPOSE 4111 EXPOSE 4111
CMD ["npm", "run", "start"] CMD ["npm", "run", "start"]