I get an error when build docker image with this setup
FROM node:16-alpine as builder
WORKDIR /usr/src/app
COPY ["package*.json", "tsconfig.*", "nest-cli.json", "src", "libs", "config", "./"]
# COPY . .
RUN npm install
RUN npm run build
FROM node:16-alpine
WORKDIR /app
COPY --from=builder /usr/src/app/package.json /usr/src/app/dist ./
COPY --from=builder /usr/src/app/node_modules ./node_modules
# Create a group and user
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
RUN chown -R appuser:appgroup /usr/src/app
# Tell docker that all future commands should run as the appuser user
USER appuser
CMD ["node", "dist/main"]
I attach my folder structure and error facing.
if I replace COPY ["package*.json", "tsconfig.*", "nest-cli.json", "src", "libs", "config", "./"] to # COPY . . It work ok
Can't found where I missing. Please help me thank you