💚 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 --from=pruner /app/out/full/ .
|
||||||
COPY turbo.json turbo.json
|
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 SKIP_ENV_CHECK=true pnpm turbo run build --filter=${SCOPE}...
|
||||||
RUN pnpm turbo run build --filter=${SCOPE}...
|
|
||||||
|
|
||||||
FROM base AS runner
|
FROM base AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
@ -54,32 +54,34 @@ const nextConfig = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default withSentryConfig(
|
export default process.env.NEXT_PUBLIC_SENTRY_DSN
|
||||||
nextConfig,
|
? withSentryConfig(
|
||||||
{
|
nextConfig,
|
||||||
// For all available options, see:
|
{
|
||||||
// https://github.com/getsentry/sentry-webpack-plugin#options
|
// For all available options, see:
|
||||||
|
// https://github.com/getsentry/sentry-webpack-plugin#options
|
||||||
|
|
||||||
// Suppresses source map uploading logs during build
|
// Suppresses source map uploading logs during build
|
||||||
silent: true,
|
silent: true,
|
||||||
release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA + '-builder',
|
release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA + '-builder',
|
||||||
org: process.env.SENTRY_ORG,
|
org: process.env.SENTRY_ORG,
|
||||||
project: process.env.SENTRY_PROJECT,
|
project: process.env.SENTRY_PROJECT,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// For all available options, see:
|
// For all available options, see:
|
||||||
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
|
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
|
||||||
|
|
||||||
// Upload a larger set of source maps for prettier stack traces (increases build time)
|
// Upload a larger set of source maps for prettier stack traces (increases build time)
|
||||||
widenClientFileUpload: true,
|
widenClientFileUpload: true,
|
||||||
|
|
||||||
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
|
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
|
||||||
tunnelRoute: '/monitoring',
|
tunnelRoute: '/monitoring',
|
||||||
|
|
||||||
// Hides source maps from generated client bundles
|
// Hides source maps from generated client bundles
|
||||||
hideSourceMaps: true,
|
hideSourceMaps: true,
|
||||||
|
|
||||||
// Automatically tree-shake Sentry logger statements to reduce bundle size
|
// Automatically tree-shake Sentry logger statements to reduce bundle size
|
||||||
disableLogger: true,
|
disableLogger: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
: nextConfig
|
||||||
|
@ -134,32 +134,34 @@ const nextConfig = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default withSentryConfig(
|
export default process.env.NEXT_PUBLIC_SENTRY_DSN
|
||||||
nextConfig,
|
? withSentryConfig(
|
||||||
{
|
nextConfig,
|
||||||
// For all available options, see:
|
{
|
||||||
// https://github.com/getsentry/sentry-webpack-plugin#options
|
// For all available options, see:
|
||||||
|
// https://github.com/getsentry/sentry-webpack-plugin#options
|
||||||
|
|
||||||
// Suppresses source map uploading logs during build
|
// Suppresses source map uploading logs during build
|
||||||
silent: true,
|
silent: true,
|
||||||
release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA + '-viewer',
|
release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA + '-viewer',
|
||||||
org: process.env.SENTRY_ORG,
|
org: process.env.SENTRY_ORG,
|
||||||
project: process.env.SENTRY_PROJECT,
|
project: process.env.SENTRY_PROJECT,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// For all available options, see:
|
// For all available options, see:
|
||||||
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
|
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
|
||||||
|
|
||||||
// Upload a larger set of source maps for prettier stack traces (increases build time)
|
// Upload a larger set of source maps for prettier stack traces (increases build time)
|
||||||
widenClientFileUpload: true,
|
widenClientFileUpload: true,
|
||||||
|
|
||||||
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
|
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
|
||||||
tunnelRoute: '/monitoring',
|
tunnelRoute: '/monitoring',
|
||||||
|
|
||||||
// Hides source maps from generated client bundles
|
// Hides source maps from generated client bundles
|
||||||
hideSourceMaps: true,
|
hideSourceMaps: true,
|
||||||
|
|
||||||
// Automatically tree-shake Sentry logger statements to reduce bundle size
|
// Automatically tree-shake Sentry logger statements to reduce bundle size
|
||||||
disableLogger: true,
|
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,
|
...sentryEnv.runtimeEnv,
|
||||||
...posthogEnv.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) {
|
onValidationError(error) {
|
||||||
console.error(
|
console.error(
|
||||||
'❌ Invalid environment variables:',
|
'❌ Invalid environment variables:',
|
||||||
|
Reference in New Issue
Block a user