diff --git a/src/Managing.Web3Proxy/Dockerfile-web3proxy b/src/Managing.Web3Proxy/Dockerfile-web3proxy index f045a93d..5cd31656 100644 --- a/src/Managing.Web3Proxy/Dockerfile-web3proxy +++ b/src/Managing.Web3Proxy/Dockerfile-web3proxy @@ -4,24 +4,25 @@ FROM node:22.14.0-alpine # Set the working directory in the container WORKDIR /app -# COPY package*.json ./ -COPY /src/Managing.Web3Proxy/package.json ./ +# Copy package.json and package-lock.json (if you want to use the lock file) +# If your local lock file is platform-specific, add 'package-lock.json' to .dockerignore +COPY src/Managing.Web3Proxy/package*.json ./ # Declaring env ENV NODE_ENV production -# Bust cache and fully reinstall deps and lockfile each build -ARG BUILD_TIMESTAMP -RUN echo "CACHEBUST=$BUILD_TIMESTAMP" \ - && rm -rf node_modules package-lock.json \ - && npm install --package-lock-only \ - && npm ci --no-audit --fund=false +# Install dependencies in the correct environment +# We remove the "npm install --package-lock-only" step. +# "npm ci" requires a lock file, "npm install" will generate one if absent. +RUN npm ci --no-audit --fund=false +# If you don't have a local package-lock.json or are ignoring it, use "npm install" instead of "npm ci" +# Copy the rest of the application source code 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 EXPOSE 4111 -CMD ["npm", "run", "start"] \ No newline at end of file +CMD ["npm", "run", "start"]