ARG PAYLOAD_SECRET
FROM base as runtime
ARG PAYLOAD_SECRET=xxx
.env
FROM node:18.8-alpine as baseFROM base as builderWORKDIR /home/node/appCOPY package*.json ./COPY . .RUN yarn installRUN yarn buildFROM base as runtimeENV NODE_ENV=productionENV PAYLOAD_CONFIG_PATH=dist/payload.config.jsENV DATABASE_URI=xxxENV NEXT_PRIVATE_DRAFT_SECRET=xxxENV NEXT_PRIVATE_REVALIDATION_KEY=xxxENV NEXT_PUBLIC_IS_LIVE=falseENV NEXT_PUBLIC_SERVER_URL=https://xxxENV PAYLOAD_PUBLIC_DRAFT_SECRET=xxxENV PAYLOAD_PUBLIC_SERVER_URL=https://xxxENV PAYLOAD_SECRET=xxxENV PORT=3000ENV REVALIDATION_KEY=xxxWORKDIR /home/node/appCOPY package*.json ./COPY yarn.lock ./RUN yarn install --productionCOPY --from=builder /home/node/app/dist ./distCOPY --from=builder /home/node/app/build ./buildEXPOSE 3000CMD ["node", "dist/server.js"]
FROM node:18.8-alpine as baseFROM base as builderWORKDIR /home/node/appCOPY package*.json ./COPY . .RUN yarn installRUN yarn buildFROM base as runtimeENV NODE_ENV=productionENV PAYLOAD_CONFIG_PATH=dist/payload.config.jsWORKDIR /home/node/appCOPY package*.json ./COPY yarn.lock ./RUN yarn install --productionCOPY --from=builder /home/node/app/dist ./distCOPY --from=builder /home/node/app/build ./buildEXPOSE 3000CMD ["node", "dist/server.js"]