Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev dependecies in Docker #30

Open
adamtretera opened this issue May 6, 2024 · 0 comments
Open

Dev dependecies in Docker #30

adamtretera opened this issue May 6, 2024 · 0 comments

Comments

@adamtretera
Copy link

So when I try to build a docker image with this

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 ?

I wanna run docker image in prod mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant