Fix Resend API key error during build

- Move Resend client instantiation from module level to function
- Add validation to skip placeholder API keys
- Set empty RESEND_API_KEY and GOOGLE_SERVICE_ACCOUNT_JSON during build
This commit is contained in:
Marco Gallegos
2026-01-18 15:08:17 -06:00
parent 0351d8ac9d
commit 8bc9c959b5
4 changed files with 51 additions and 157 deletions

36
Dockerfile.coolify Normal file
View File

@@ -0,0 +1,36 @@
# Dockerfile simplificado para Coolify
FROM node:20-alpine
WORKDIR /app
# Instalar dependencias
COPY package.json package-lock.json ./
RUN npm ci --ignore-scripts
# Copiar código fuente
COPY . .
# Variables de entorno
ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_ENV=production
ENV NEXT_PUBLIC_SUPABASE_URL=https://placeholder.supabase.co
ENV NEXT_PUBLIC_SUPABASE_ANON_KEY=placeholder-anon-key
# Aumentar memoria para build
ENV NODE_OPTIONS="--max-old-space-size=4096"
# Build
RUN npm run build
# Configurar usuario
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["npm", "start"]