Next.js Discord

Discord Forum

Next.js/PayloadCMS deploy on Docker Hub

Unanswered
Turkish Angora posted this in #help-forum
Open in Discord
Turkish AngoraOP
Hi,

Can someone help me with Docker deplayment with PayloadCMS, i have this Dockerfile:

FROM node:18.8-alpine as base

FROM base as build

WORKDIR /home/node/app
COPY package*.json ./

COPY . .
RUN yarn install
RUN yarn build

FROM base as runtime

ENV NODE_ENV=production
ENV PAYLOAD_CONFIG_PATH=dist/payload.config.js

WORKDIR /home/node/app
COPY package*.json  ./
COPY yarn.lock ./

RUN yarn install --production
COPY --from=build /home/node/app/dist ./dist
COPY --from=build /home/node/app/build ./build

EXPOSE 3000

CMD ["node", "dist/server.js"]


This is my log from Portainer:
2024-02-19T21:22:37.694864465Z (node:1) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
2024-02-19T21:22:37.694947937Z (Use `node --trace-warnings ...` to show where the warning was created)
2024-02-19T21:22:37.719894478Z unhandledRejection [Error: ENOENT: no such file or directory, open '/home/node/app/.next/BUILD_ID'] {
2024-02-19T21:22:37.719939006Z   errno: -2,
2024-02-19T21:22:37.719948675Z   code: 'ENOENT',
2024-02-19T21:22:37.719957943Z   syscall: 'open',
2024-02-19T21:22:37.719964587Z   path: '/home/node/app/.next/BUILD_ID'
2024-02-19T21:22:37.719976764Z }
2024-02-19T21:22:38.425407125Z [21:22:37] INFO (payload): Connected to MongoDB server successfully!
2024-02-19T21:22:38.428801786Z [21:22:37] INFO (payload): Starting Payload...
2024-02-19T21:22:38.428846188Z [21:22:37] INFO (payload): Payload Admin URL: /admin


Thanks in advance!

1 Reply

English Lop