D
Dokploy10mo ago
youzai

Deploy fail

I deployed a small nextjs project of mine, which can be easily deployed on vercel. However, on dokploy, the cup and memory are close to 100%, and the server crashes directly. I use a brand new 2-core 4g server, and only deploy it. dokploy project, I don’t know why this is happening. The log always stays at Creating an optimized production build..., can anyone help me?
No description
16 Replies
Siumauricio
Siumauricio10mo ago
This is a common problem, unfortunately it is not a problem that we can fix, it is more a problem with docker & nixpacks that makes it consume too much RAM which sometimes causes your VPS to freeze for seconds, an effective solution is to basically increase the resources of your VPS or else create your own dockerfile.
youzai
youzaiOP10mo ago
I used the dockerfile deployment method, but the result still stayed at this line of logs without any changes. This is my dockerfile. FROM node:18-alpine AS builder RUN npm install -g pnpm WORKDIR /app COPY package.json pnpm-lock.yaml* ./ RUN pnpm install --frozen-lockfile COPY . . RUN pnpm build FROM node:18-alpine WORKDIR /app COPY --from=builder /app/package.json /app/pnpm-lock.yaml* ./ COPY --from=builder /app/.next ./.next COPY --from=builder /app/public ./public COPY --from=builder /app/next.config.js ./ COPY --from=builder /app/node_modules ./node_modules EXPOSE 3000 CMD ["pnpm", "start"]
Siumauricio
Siumauricio10mo ago
you from china?
youzai
youzaiOP10mo ago
yes
Siumauricio
Siumauricio10mo ago
I don't know why this kind of problems usually come from people from China, I don't know if it's a server restriction or something like that 🤔 Surely if I deploy your project it will work without problems, I do not know if it is a connection problem. what vps provider are you using?
youzai
youzaiOP10mo ago
If so, when I deploy one of the projects, it may affect all projects on the server. For this production environment, it is catastrophic. I am using a server in the United States, so there are no connection issues.
Siumauricio
Siumauricio10mo ago
what provider? I have several servers with several nextjs apps and without any problem.
youzai
youzaiOP10mo ago
aliyun
Siumauricio
Siumauricio10mo ago
that's alibaba right?
youzai
youzaiOP10mo ago
yes What provider do you recommend here? I'll try it.
Siumauricio
Siumauricio10mo ago
I honestly don't trust on that one, I'll recommend Hetnzer, Digitalocean that never failed me and the performance is abismal compared to other providers like aws, alibaba and others
youzai
youzaiOP10mo ago
OK, I'll try
youzai
youzaiOP10mo ago
I used digitalocean's 2-core 4G server deployment and built it using the same project. The build was successful, but the build process consumed a lot of resources.
No description
youzai
youzaiOP10mo ago
This is a small nextjs project. I don’t know if he will encounter the same problem in a slightly larger project.
Siumauricio
Siumauricio10mo ago
Yeah the build is the thing which take alot of resources, like running your application is probably nothing compared to build a project the best thing is to build the project in a CI/CD and then in dokploy just download the image and run
youzai
youzaiOP10mo ago
Are there any CI/CD projects suitable for nextjs? I'll go find out

Did you find this page helpful?