Deploy NextJs Issue
Hi, I justy start to use dokploy to deploy nextjs application.
I encounter a problem.
My Frontend Nextjs project use PNPM and when I click the deploy button, it meets failure.
Can you help me debug this error?
Error Message
#10 [stage-0 6/10] RUN --mount=type=cache,id=oTFgebIbq8s-/root/local/share/pnpm/store/v3,target=/root/.local/share/pnpm/store/v3 pnpm i --frozen-lockfile
#10 0.668 WARN Ignoring not compatible lockfile at /app/pnpm-lock.yaml
#10 0.672 ERR_PNPM_NO_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is absent
#10 0.672
#10 0.672 Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"
#10 ERROR: process "/bin/bash -ol pipefail -c pnpm i --frozen-lockfile" did not complete successfully: exit code: 1
------
22 | # build phase -------------------- ERROR: failed to solve: process "/bin/bash -ol pipefail -c pnpm i --frozen-lockfile" did not complete successfully: exit code: 1 Error: Docker build failed Error response from daemon: No such container: image-service-frontend-nextjs-7366b0-tJU7Rv4mFU Error ❌
[stage-0 6/10] RUN --mount=type=cache,id=oTFgebIbq8s-/root/local/share/pnpm/store/v3,target=/root/.local/share/pnpm/store/v3 pnpm i --frozen-lockfile:0.668 WARN Ignoring not compatible lockfile at /app/pnpm-lock.yaml 0.672 ERR_PNPM_NO_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is absent 0.672 0.672 Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile" ------ Dockerfile:20 -------------------- 18 | ENV NIXPACKS_PATH /app/node_modules/.bin:$NIXPACKS_PATH 19 | COPY . /app/. 20 | >>> RUN --mount=type=cache,id=oTFgebIbq8s-/root/local/share/pnpm/store/v3,target=/root/.local/share/pnpm/store/v3 pnpm i --frozen-lockfile 21 |
22 | # build phase -------------------- ERROR: failed to solve: process "/bin/bash -ol pipefail -c pnpm i --frozen-lockfile" did not complete successfully: exit code: 1 Error: Docker build failed Error response from daemon: No such container: image-service-frontend-nextjs-7366b0-tJU7Rv4mFU Error ❌

89 Replies
I think the issue is clear
ERR_PNPM_NO_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is absent
Thank you for your reply. Can you tell me what should I do to fix this bug?
what version of pnpm are you using?
Sorry, I don't know how to check my version of pnpm
How can I confirm
We have a simple example of nextjs check this https://github.com/Dokploy/examples/tree/main/nextjs
GitHub
examples/nextjs at main · Dokploy/examples
Examples to deploy on Dokploy. Contribute to Dokploy/examples development by creating an account on GitHub.
ok, I will check this out, thx!
I use a github provider, Now I will try the git provider.
do you have a public repo of the project you want to deploy?
it is a private one.
I try the git deploy method, still the same error
🥺
looks like the pnpm lock file is absent
Kind of weird, I can see it. And I deploy to vercel successfully

show how did you configure the github repo in the application
Here is my configuration

show your package json
{
"name": "luma-ai-eng",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "prisma generate && next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.598.0",
"@clerk/nextjs": "^5.1.5",
"@headlessui/react": "^2.0.4",
"@heroicons/react": "^2.1.3",
"@hookform/resolvers": "^3.6.0",
"@prisma/client": "5.16.2",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-radio-group": "^1.1.3",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-switch": "^1.0.3",
"@stripe/stripe-js": "^3.5.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"dayjs": "^1.11.11",
"embla-carousel-react": "^8.1.4",
"jotai": "^2.9.0",
"lucide-react": "^0.394.0",
"nanoid": "^5.0.7",
"next": "14.2.4",
"next-themes": "^0.3.0",
"next-view-transitions": "^0.2.0",
"openai": "^4.52.0",
"react": "^18",
"react-dom": "^18",
"react-hook-form": "^7.52.0",
"react-hot-toast": "^2.4.1",
"react-tweet": "^3.2.1",
"sonner": "^1.5.0",
"stripe": "^15.12.0",
"svix": "^1.24.0",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.23.8"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.13",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "14.2.4",
"postcss": "^8",
"prisma": "5.15.0",
"tailwindcss": "^3.4.1",
"typescript": "^5"
}
}
can you do pnpm -v
pnpm -v9.5.0 it is 9.5.0 in My Project Vscode Terminal
that's the reason nixpacks doesnt support pnpm 9, can you try to use heroku buildpacks in the builder?
Hi, what is the difference between these buildpacks?
Is it the same for nextjs ?
yeah is the same, they just do a different build process internally
Okay, I am trying to use heroku buildpacks
Seems like npm works great.
or if you want to use nixpacks
1. create a file call
nixpacks.toml
2. Paste this code in the file
3. Push to github
Okay, I will try it addiung nixpacks.toml resolution
It work! You are a legend

How can I support you? You may help me save hundreds of vercel billings.
It really means a lot
If you would like to support me, it would be great and much appreciated.
https://github.com/sponsors/Siumauricio or
https://opencollective.com/dokploy
GitHub
Sponsor @Siumauricio on GitHub Sponsors
Support Siumauricio's open-source work on Dokploy, a user-friendly alternative to Heroku, Vercel, and Netlify. Enhance your deployment experience with innovative solutions.
Dokploy - Open Collective
Dokploy is an open source alternative to Vercel, Heroku, Netlify.
I have sponsored 5$ for you! Nice work

Can I ask what are the notes for deploying nextjs? Or are there any common O&M issues, I can pay for it.
Wow really thank you! appreciated!
Not really, that's all you have to do, what I would recommend is to build your project and upload a docker image to dockerhub and then in dokploy just download it and run it.
Just want to ask another question. How can I add domain. I added dream.runningdogg.com in Cloudfalre and dokploy.
I add the dns record to point to the Server Ip. But I can not visit it
in the domains tab

DO you recommend using DockerImage to build my project? Instead of using builder

I can see the domain

This is my dns setting, Is it anything wrong?
edit the domain and in the port set port 3000 and disable https
got it
Yes what are the resources of your vps?
Hetzner, I watch your youtube video and bought it
Nice, that's the best and how much are you paying for it?
Strill 502 error, do not know why
did you disabled the https and set port 3000?
I am paying the 12 plan, no shared cpu beacuse I want all the vercel projects to be deployed on Hetzner
Yes

ohh that's the good one, I'm paying for that aswell
8G plan right? I do not know if it is enough, but it seems enough for me
in the content of the A record you set the ip right?
Yes
Server IP

that's the reasson
This is my SSL config on CF
I was going to ask for that
set in flexible
Got it, Before I host on vercel, it seems to be FULL
I will try it
Ok, let me knwo if its work

I make it flexible, but it meets another error

just close it, try access to your website
looks like is working now https://dream.runningdogg.com/
Still can not visit it.
I visit the dokploy vis domain names, I can not login right now
weird
yeah is because you changed the SSL mode
DO I need to change back to FULL?
Yeah
If I switch into FULL mode, I can visit my dokploy page. But still can not visit the domain

Ok, so in the domain activate the https and select letsencrypt
seems like the same error

I can access to https://dream.runningdogg.com/

Sorry to ask so many questions.
If I need to add env to my project, do I need to redeploy?
yes
GOT it , I will retry
Weird..
the auto-generation domain seems to work. But The browser strill reminds it is not safe.
And dream.runningdogg.com seems not to work
In my case I see the https version
butt if you want to force the https you can do in cloudflare
okay, I will restart the browser. Thanks so much for your support
If I can use dokploy to host my project, I will donate another 10$ for your work. Legend
Really thank you!! apreciated man, let me know if you have another questions
Got you
Bye~
Oh , It really works!!!!! Seems like I can not pay another one-time payment. Big Thanks Bro .

🥲 Github issues
hi
can i ask another question here?
I want to deploy , not after I push to github , I want it like vercel --prod.
Does Dokploy has that function?
In my case I have three different projects project-develop, project-staging, project-staging and when you merge changes in GitHub in the specific branch you can automatize the deployment to specific branch
hi
Just want to ask another question~
which package manager do you recommend? npm or pnpm? Which one do you prefer?
I use pnpm, and I don't know if it is best
Pnpm
True, more fast
thanks!
I want to ask another question, After deploying 1 nextjs object, i find out that it tasks about 8.5 GB Space.
SO My question is, is it always 7-8 GB per project ? Beacuse I bought a server with 16gb Memory and 160GB Space. And I am not certain if the sever can host many projects the same time.
@Siumauricio
and is it safe to use clean all option?

Yes is so safe
clean all
and is not 7-8GB per projectI have several projects and only 12GB, take into account the docker containers.


@Freilyn Bernabe thank you!