Very slow build
#1079
Replies: 1 comment
-
Would need a repro with logs and the GitHub Actions workflow: https://github.com/docker/build-push-action/issues/new?assignees=&labels=status%2Ftriage&projects=&template=bug.yml |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've never had this problem on this PC before. I haven’t built on it for a long time, now when I build, the build is very slow. Although the computer has 8 cores, good cleanliness, 16 GB of RAM (of which only 11 are used), 400 MB of Internet.
I'm running a build in a project on next.js 14.01
I also put everything I need in dockerigonre
My Dockerfile:
multy stage dockerfile
FROM node:lts-alpine as node_modules_dev
Create app directory
WORKDIR /app
Install app dependencies
COPY package*.json ./
RUN npm ci
FROM node:lts-alpine as node_modules_prod
Create app directory
WORKDIR /app
Install app dependencies
COPY package*.json ./
RUN npm ci --omit=dev
[FROM node:lts-alpine AS builder
Create app directory
WORKDIR /app
A wildcard is used to ensure both package.json AND package-lock.json are copied
COPY package*.json ./
COPY prisma ./prisma/
COPY next.config.js ./
COPY --from=node_modules_dev /app/node_modules ./node_modules
RUN npx prisma generate
COPY . .
ENV NODE_ENV=production
RUN npm run build
RUN npx prisma migrate deploy
FROM node:lts-alpine
WORKDIR /app
COPY --from=builder /app/node_modules ./node_modules
COPY package*.json ./
COPY --from=node_modules_prod /app/node_modules ./node_modules
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY prisma ./prisma/
COPY next.config.js ./
COPY xmlTasks ./xmlTasks
COPY .env.prod .env
RUN npx prisma generate
ENV NODE_ENV=production
RUN echo "* * * * * /usr/local/bin/node /app/xmlTasks/index.js" >> /etc/crontab
RUN (crontab -u$(whoami) -l; echo "* * * * * /usr/local/bin/node /app/xmlTasks/index.js" ) | crontab -u $ (whoami) -
EXPOSE 3000](url)
Beta Was this translation helpful? Give feedback.
All reactions