Dockerized Deployment - Any tips? #50
-
Hey all, just starting out playing around with this and I'm trying to get an understanding on how this is supposed to be deployed with docker. Opened a ticket and realized it was better suited as a conversation here as it is less of a bug, and more of a "Is this intended?". I've been able to run this locally, but when it comes to deployment I wanted to containerize this using docker and deploy it using CI/CD. I've read through the docs and followed the docker build process but from what I can tell this isn't intended to be built on one system then deployed in another? Rather that the docker image needs to be built with access to the DB due to the end of the NPM command here: {
"build:next": "cross-env PAYLOAD_CONFIG_PATH=dist/payload/payload.config.js NEXT_BUILD=true node dist/server.js",
"build": "cross-env NODE_ENV=production yarn build:payload && yarn build:server && yarn copyfiles && yarn build:next",
} This if (process.env.NEXT_BUILD) {
app.listen(PORT, async () => {
payload.logger.info(`Next.js is now building...`)
// @ts-expect-error
await nextBuild(path.join(__dirname, '../'))
process.exit()
})
return
} Which requires that the DB is accessible, otherwise you get an error around "mongoDB is inaccessible", which fails the installation. I can move the if (process.env.NEXT_BUILD) {
// @ts-expect-error
await nextBuild(path.join(__dirname, '../'))
return
} The downside is that (I assume it's related) I only get blank pages on all of my
Any advice would be appreciated! Thanks! :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Looks like this is not possible with V2, V3 now supports scalable docker design. |
Beta Was this translation helpful? Give feedback.
Looks like this is not possible with V2, V3 now supports scalable docker design.