Some checks failed
Build and Push Docker Images / docker (push) Failing after 2m20s
BREAKING CHANGE: All environment variables are now runtime-configurable Changes: - Removed ALL build-time NEXT_PUBLIC_* variables from Dockerfile and CI/CD - Created server-side proxy routes for Wren API (/api/wren/*) - Refactored wrenClient.ts to use proxy endpoints (reduced from 400+ to 200 lines) - Updated checkoutClient.ts and emailClient.ts to remove NEXT_PUBLIC_ fallbacks - Hardcoded metadataBase in layout.tsx (no longer depends on env var) - Updated .env.local to use runtime-only variables (WREN_API_TOKEN, NocoDB config) Security improvements: - Wren API token never exposed to browser - All secrets stay server-side - No sensitive data baked into build Configuration: - Wren API: Set WREN_API_TOKEN in docker-compose or .env - NocoDB: Set NOCODB_* variables in docker-compose or .env - No Gitea secrets/variables needed for build (only registry credentials) Docker build is now truly environment-agnostic - same image works in any environment with different runtime configuration.
38 lines
844 B
Docker
38 lines
844 B
Docker
# Build Stage
|
|
FROM node:20-alpine AS build
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files and install dependencies
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
|
|
# Copy the rest of the app
|
|
COPY . .
|
|
|
|
# Build Next.js app (standalone mode)
|
|
# All environment variables are runtime-configurable via .env or docker-compose
|
|
RUN npm run build
|
|
|
|
# Production Stage - Next.js standalone server
|
|
FROM node:20-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy standalone server files from build stage
|
|
COPY --from=build /app/.next/standalone ./
|
|
COPY --from=build /app/.next/static ./.next/static
|
|
COPY --from=build /app/public ./public
|
|
|
|
# Expose port 3000
|
|
EXPOSE 3000
|
|
|
|
# Set environment to production
|
|
ENV NODE_ENV=production
|
|
ENV PORT=3000
|
|
ENV HOSTNAME="0.0.0.0"
|
|
|
|
# Start Next.js server
|
|
# Runtime environment variables (NEXT_PUBLIC_*) can be passed via docker-compose or -e flags
|
|
CMD ["node", "server.js"]
|