diff --git a/Dockerfile b/Dockerfile index fccbc85..e185d3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,12 @@ # Build stage -FROM node:20-alpine as build -ARG APP_DIR=app -RUN mkdir -p ${APP_DIR} -WORKDIR ${APP_DIR} +FROM node:20-alpine AS builder +WORKDIR /app -COPY package*.json ./src/ ./ -RUN npm install -CMD ["npm", "run", "build"] +COPY . . +RUN npm ci +RUN npm run build # Run stage -FROM node:20-alpine -COPY --from=build ./build ./ -CMD ["node", "index.js"] \ No newline at end of file +FROM node:20-alpine AS runner +COPY --from=builder /app/build . +CMD ["node", "index.js"]