Docker run problems

default discord avatar
xavierpacheco
3 months ago
2

I am having this error on my docker run, but I don't use GraphQl in my build and I don't have this error running locally.



[11:33:01] INFO (payload): Starting Payload...
/home/node/app/node_modules/payload/node_modules/graphql/jsutils/devAssert.js:12
    throw new Error(message);
    ^

Error: Expected DateTime to be a GraphQL nullable type.
    at devAssert (/home/node/app/node_modules/payload/node_modules/graphql/jsutils/devAssert.js:12:11)
    at new GraphQLNonNull (/home/node/app/node_modules/payload/node_modules/graphql/type/definition.js:395:32)
    at /home/node/app/node_modules/payload/dist/collections/graphql/init.js:101:23
    at Array.forEach (<anonymous>)
    at initCollectionsGraphQL (/home/node/app/node_modules/payload/dist/collections/graphql/init.js:60:38)
    at registerSchema (/home/node/app/node_modules/payload/dist/graphql/registerSchema.js:58:24)
    at init (/home/node/app/node_modules/payload/dist/init.js:79:38)
    at initSync (/home/node/app/node_modules/payload/dist/init.js:143:22)
    at Payload.init (/home/node/app/node_modules/payload/dist/index.js:154:29)
    at Object.<anonymous> (/home/node/app/dist/server.js:17:19)

Node.js v18.16.0

from this Dockerfile


FROM node:18-alpine as base

FROM base as builder

WORKDIR /home/node/app

COPY package*.json ./
COPY . .

RUN npm install 
RUN npm install copyfiles
RUN npm run generate:types
RUN npm run build

FROM base as runtime

ENV NODE_ENV=production
ENV PAYLOAD_CONFIG_PATH=/home/node/app/dist/payload.config.js

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

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


EXPOSE 8080

CMD ["node", "dist/server.js"]
  • discord user avatar
    jesschow
    Payload Team
    3 months ago

    Hi @xavierpacheco - if you disable graphQL in your payload.config, do you still get this error?



    i.e.


    graphQL: {
      disable: true
    }
  • default discord avatar
    xavierpacheco
    3 months ago

    It's fixed!

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.