💚 Fix docker build when Sentry not enabled
This commit is contained in:
@ -27,8 +27,7 @@ RUN pnpm install
|
||||
COPY --from=pruner /app/out/full/ .
|
||||
COPY turbo.json turbo.json
|
||||
|
||||
ENV ENCRYPTION_SECRET=encryption_secret_placeholder123 DATABASE_URL=postgresql://postgres:typebot@typebot-db:5432/typebot NEXTAUTH_URL=http://localhost:3000 NEXT_PUBLIC_VIEWER_URL=http://localhost:3001
|
||||
RUN pnpm turbo run build --filter=${SCOPE}...
|
||||
RUN SKIP_ENV_CHECK=true pnpm turbo run build --filter=${SCOPE}...
|
||||
|
||||
FROM base AS runner
|
||||
WORKDIR /app
|
||||
|
@ -54,7 +54,8 @@ const nextConfig = {
|
||||
},
|
||||
}
|
||||
|
||||
export default withSentryConfig(
|
||||
export default process.env.NEXT_PUBLIC_SENTRY_DSN
|
||||
? withSentryConfig(
|
||||
nextConfig,
|
||||
{
|
||||
// For all available options, see:
|
||||
@ -83,3 +84,4 @@ export default withSentryConfig(
|
||||
disableLogger: true,
|
||||
}
|
||||
)
|
||||
: nextConfig
|
||||
|
@ -134,7 +134,8 @@ const nextConfig = {
|
||||
},
|
||||
}
|
||||
|
||||
export default withSentryConfig(
|
||||
export default process.env.NEXT_PUBLIC_SENTRY_DSN
|
||||
? withSentryConfig(
|
||||
nextConfig,
|
||||
{
|
||||
// For all available options, see:
|
||||
@ -163,3 +164,4 @@ export default withSentryConfig(
|
||||
disableLogger: true,
|
||||
}
|
||||
)
|
||||
: nextConfig
|
||||
|
4
packages/env/env.ts
vendored
4
packages/env/env.ts
vendored
@ -324,7 +324,9 @@ export const env = createEnv({
|
||||
...sentryEnv.runtimeEnv,
|
||||
...posthogEnv.runtimeEnv,
|
||||
},
|
||||
skipValidation: typeof window !== 'undefined' && window.__ENV === undefined,
|
||||
skipValidation:
|
||||
process.env.SKIP_ENV_CHECK === 'true' ||
|
||||
(typeof window !== 'undefined' && window.__ENV === undefined),
|
||||
onValidationError(error) {
|
||||
console.error(
|
||||
'❌ Invalid environment variables:',
|
||||
|
Reference in New Issue
Block a user