2
0

💚 Fix docker build when Sentry not enabled

This commit is contained in:
Baptiste Arnaud
2023-10-10 15:04:17 +02:00
parent 49826d1303
commit 54788a828e
4 changed files with 56 additions and 51 deletions

View File

@ -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

View File

@ -54,7 +54,8 @@ const nextConfig = {
}, },
} }
export default withSentryConfig( export default process.env.NEXT_PUBLIC_SENTRY_DSN
? withSentryConfig(
nextConfig, nextConfig,
{ {
// For all available options, see: // For all available options, see:
@ -83,3 +84,4 @@ export default withSentryConfig(
disableLogger: true, disableLogger: true,
} }
) )
: nextConfig

View File

@ -134,7 +134,8 @@ const nextConfig = {
}, },
} }
export default withSentryConfig( export default process.env.NEXT_PUBLIC_SENTRY_DSN
? withSentryConfig(
nextConfig, nextConfig,
{ {
// For all available options, see: // For all available options, see:
@ -163,3 +164,4 @@ export default withSentryConfig(
disableLogger: true, disableLogger: true,
} }
) )
: nextConfig

4
packages/env/env.ts vendored
View File

@ -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:',