FROM node:20-bookworm-slim as builder
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --no-cache --frozen-lockfile
ENV NODE_ENV=production
COPY . .
RUN yarn build && yarn install --no-cache --ignore-scripts --prefer-offline
FROM node:20-bookworm-slim AS runner
WORKDIR /app
RUN addgroup --gid 1001 --system nodejs
COPY --chown=1001:1001 --from=builder /app /app
USER favdog
ENV NODE_ENV=production
CMD ["node", "./dist/server.js"]
Nothing to fancy I would say - but am getting error on the dev dependecnies not present in the is it becasue the docker should contain just the files builded by vite ?
but inside the server.ts there is also used vite - createServer
which is also rightfully dev dependency ?
So when I try to build a docker image with this
Nothing to fancy I would say - but am getting error on the dev dependecnies not present in the is it becasue the docker should contain just the files builded by vite ?
but inside the server.ts there is also used vite - createServer which is also rightfully dev dependency ?
I wanna run docker image in prod mode