chore: make it skip env validation on build

This commit is contained in:
Artur
2024-08-28 20:08:19 -03:00
parent 5de38cf177
commit aab6a7ccaf
2 changed files with 7 additions and 1 deletions

View File

@@ -71,6 +71,7 @@ WORKDIR /app
EXPOSE 3000
ENV PORT 3000
ENV HOSTNAME "0.0.0.0"
# Install Prisma CLI
RUN mkdir /home/nextjs/.npm-global
@@ -82,4 +83,4 @@ RUN npm cache clean --force
# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
CMD ["/bin/sh", "-c", "prisma migrate deploy && HOSTNAME='0.0.0.0' node server.js"]
CMD ["/bin/sh", "-c", "prisma migrate deploy && node server.js"]

View File

@@ -95,4 +95,9 @@ export const env = createEnv({
SENDGRID_VERIFIED_SENDER: process.env.SENDGRID_VERIFIED_SENDER,
SENDGRID_API_KEY: process.env.SENDGRID_API_KEY,
},
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially
* useful for Docker builds.
*/
skipValidation: !!process.env.SKIP_ENV_VALIDATION,
})