# Example .dockerignore file content: # .git # node_modules # npm-debug.log # build # dist # .env FROM alpine/git AS git_cloner WORKDIR /app RUN git clone https://github.com/myuser/myrepo.git . FROM node:lts-alpine WORKDIR /app # Copy only essential files for dependencies first to leverage caching # If package.json doesn't change, 'npm install' layer is reused. COPY package.json package-lock.json ./ RUN npm ci --only=production # Copy the rest of the application code. .dockerignore will exclude unnecessary files. COPY . . EXPOSE 3000 CMD ["npm", "start"]