Docker cannot Build without access to database - ERROR (payload): Error: cannot connect to MongoDB. Details: getaddrinfo ENOTFOUND mongo #6330
Labels
status: needs-triage
Possible bug which hasn't been reproduced yet
Link to reproduction
No response
Describe the Bug
Currently trying to build and deploy an docker image for payload. Maybe there is a different process in mind for how to deploy this to production, but my flow is:
Now when I go to build the project using the
Dockerfile
it looks that it is trying to access the database during build:Which makes this not possible as you cannot deploy without already having access to the DB. Meaning either the CI pipeline has to be within the cluster with the MongoDB instance, or you have to expose the MongoDB instance outside the cluster to the CI pipeline.
Is there any way to build this as an image, then deploy? Or is this a limitation that this cannot be used in Swarm/K8s?
Is it possible to have the DB scripts run once the image has deployed, instead of having them run while building?
Thanks! :)
To Reproduce
docker build .
Payload Version
2.13.0
Adapters and Plugins
No response
The text was updated successfully, but these errors were encountered: