Open wyxcoder opened 4 months ago
The issue seems to be specific to the ecommerce template.
Line 15 in the Dockerfile is wrong: ENV PAYLOAD_CONFIG_PATH=dist/payload.config.js
. Build actually outputs the config to dist/payload/
.
Even if you fix that, the app fails to launch because of missing .next
folder (if you're using the ecommerce template frontend), so here are the Dockerfile edits to hopefully get it running:
ENV PAYLOAD_CONFIG_PATH=dist/payload/payload.config.js
COPY --from=builder /home/node/app/.next ./.next
after line 23.
Link to reproduction
No response
Describe the Bug
I tried to deploy the code to Cloud Run, but encountered strange errors. I then tried to build local docker image. I did the below steps: 1, docker build . --tag able-wso , this step completed fine 2, docker run -e PAYLOAD_SECRET=thisisatest -e PAYLOAD_PUBLIC_SERVER_URL=http://localhost:8080 -e http://localhost:8080 -e DATABASE_URI=mongodb://127.0.0.1/payload-template-ecommerce able-wso
I got error unhandledRejection Error: Cannot find module '/home/node/app/dist/payload.config.js' I tried to solve this error by copying payload.config.js over, but then I got another error and more errors.
I wonder if this Dockerfile was tested. Or simply I did someone wrong?
To Reproduce
npx create-payload-app@latest to create a website named able-wso docker build . --tag able-wso docker run -e PAYLOAD_SECRET=thisisatest -e PAYLOAD_PUBLIC_SERVER_URL=http://localhost:8080 -e http://localhost:8080 -e DATABASE_URI=mongodb://127.0.0.1/payload-template-ecommerce able-wso
Payload Version
v2
Adapters and Plugins
db-mongodb