chore: generate source maps for sentry on build and cleanup dockerfile

This commit is contained in:
Artur
2025-05-05 12:25:42 -03:00
parent 4a14125b03
commit 212fef48d2
3 changed files with 2 additions and 18 deletions

View File

@@ -18,18 +18,13 @@ RUN \
else echo "Lockfile not found." && exit 1; \
fi
# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build.
ENV NEXT_TELEMETRY_DISABLED 1
ENV BUILD_MODE 1
ENV PRISMA_BINARY_TARGETS='["native", "rhel-openssl-1.0.x"]'
ENV NEXT_PUBLIC_TURNSTILE_SITEKEY='0x4AAAAAAA11o5rNvbUuAWSJ'
ENV NEXT_PUBLIC_MONERO_APPLICATION_RECIPIENT='monerofund@magicgrants.org'
@@ -52,12 +47,8 @@ WORKDIR /app
RUN apk add --no-cache libc6-compat
ARG BUILD_MODE=1
ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime.
ENV NEXT_TELEMETRY_DISABLED 1
ENV BUILD_MODE 1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

View File

@@ -8,7 +8,6 @@ export const env = createEnv({
* Will throw if you access these variables on the client.
*/
server: {
BUILD_MODE: z.boolean(),
APP_URL: z.string().url(),
NEXTAUTH_SECRET: z.string().min(32),
USER_SETTINGS_JWT_SECRET: z.string().min(32),
@@ -80,7 +79,6 @@ export const env = createEnv({
* 💡 You'll get type errors if not all variables from `server` & `client` are included here.
*/
runtimeEnv: {
BUILD_MODE: !!process.env.BUILD_MODE,
APP_URL: process.env.APP_URL,
NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET,
USER_SETTINGS_JWT_SECRET: process.env.USER_SETTINGS_JWT_SECRET,
@@ -145,9 +143,4 @@ export const env = createEnv({
COINBASE_COMMERCE_API_KEY: process.env.COINBASE_COMMERCE_API_KEY,
COINBASE_COMMERCE_WEBHOOK_SECRET: process.env.COINBASE_COMMERCE_WEBHOOK_SECRET,
},
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially
* useful for Docker builds.
*/
skipValidation: !!process.env.BUILD_MODE,
})

View File

@@ -8,7 +8,7 @@
"start": "next start",
"lint": "next lint",
"watch": "npm-watch",
"sentry:sourcemaps": "sentry-cli sourcemaps inject --org magic-grants --project campaign-site ./out && sentry-cli sourcemaps upload --org magic-grants --project campaign-site ./out"
"sentry:sourcemaps": "tsc && sentry-cli sourcemaps inject --org magic-grants --project campaign-site ./out && sentry-cli sourcemaps upload --org magic-grants --project campaign-site ./out"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.5.2",
@@ -127,4 +127,4 @@
"extensions": "js,jsx,tsx,ts,css,scss,md"
}
}
}
}