payloadcms / payloadcms/payload
Dockerfile from template broken
Open
@denolfe is already working on this.
Since Dec 1, 2025.
- Dominant language
- TypeScript
- Stars
- 44.8k
- Forks
- 4.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 53
Description
Describe the Bug
The dockerfile from the template has a lot of issues. Having fixed one by one, this last one makes no sense. Why would the docker build require access to the DB. Clearly completely misunderstood what containers are about.
13 27.64 [23:35:20] ERROR: Error: cannot connect to Postgres. Details: getaddrinfo ENOTFOUND pg
#13 27.64 err: {
#13 27.64 "type": "Error",
#13 27.64 "message": "getaddrinfo ENOTFOUND pg",
#13 27.64 "stack":
#13 27.64 Error: getaddrinfo ENOTFOUND pg
#13 27.64 at /app/node_modules/pg-pool/index.js:45:11
#13 27.64 at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
#13 27.64 at async h (/app/.next/server/chunks/9083.js:151:9649)
#13 27.64 at async Object.i [as connect] (/app/.next/server/chunks/9083.js:151:9891)
#13 27.64 at async bD.init (/app/.next/server/chunks/9083.js:277:7886)
#13 27.64 at async bG (/app/.next/server/chunks/9083.js:277:11051)
#13 27.64 at async Object.p [as generateStaticParams] (/app/.next/server/app/(frontend)/posts/page/[pageNumber]/page.js:2:8710)
#13 27.64 at async builtRouteParams (/app/node_modules/next/dist/build/static-paths/app.js:396:36)
#13 27.64 at async buildAppStaticPaths (/app/node_modules/next/dist/build/static-paths/app.js:366:25)
#13 27.64 at async /app/node_modules/next/dist/build/utils.js:925:79
#13 27.64 "errno": -3008,
#13 27.64 "code": "ENOTFOUND",
#13 27.64 "syscall": "getaddrinfo",
#13 27.64 "hostname": "pg"
#13 27.64 }
How is the docker container supposed to work?
Link to the code that reproduces this issue
123123
Reproduction Steps
123123
Which area(s) are affected? (Select all that apply)
db: postgres
Environment Info
123123
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.