2388873e7a
- Fix duplicate 'signature' variable in webhooks.ts - Add Prisma binary target for Alpine Linux - Fix tsconfig path alias (@/* -> ./src/*) - Add missing next-themes dependency - Add build args for NEXT_PUBLIC_* env vars - Fix SSR issues with zustand and providers - Add providers-wrapper with dynamic ssr:false import - Add SSL certs and public dir for nginx - Update Dockerfiles for proper Prisma engine handling
54 lines
1.2 KiB
Docker
54 lines
1.2 KiB
Docker
# Build stage
|
|
FROM node:20-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install build tools for native modules
|
|
RUN apk add --no-cache python3 make g++ libusb-dev eudev-dev linux-headers
|
|
|
|
# Copy root package files for workspace install
|
|
COPY package*.json ./
|
|
COPY frontend/package*.json ./frontend/
|
|
|
|
# Install dependencies
|
|
RUN npm install --legacy-peer-deps
|
|
|
|
# Copy frontend source
|
|
COPY frontend/ ./frontend/
|
|
|
|
# Build args for Next.js
|
|
ARG NEXT_PUBLIC_API_URL
|
|
ARG NEXT_PUBLIC_SOLANA_NETWORK
|
|
ARG NEXT_PUBLIC_SOLANA_RPC_URL
|
|
|
|
# Build Next.js app
|
|
WORKDIR /app/frontend
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
|
RUN npx next build --webpack
|
|
|
|
# Production stage
|
|
FROM node:20-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
COPY frontend/package*.json ./frontend/
|
|
|
|
# Copy node_modules from builder (includes compiled native modules)
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
|
|
# Copy built files from builder
|
|
COPY --from=builder /app/frontend/.next ./frontend/.next
|
|
COPY --from=builder /app/frontend/public ./frontend/public
|
|
COPY --from=builder /app/frontend/next.config.js ./frontend/
|
|
|
|
WORKDIR /app/frontend
|
|
|
|
# Expose port
|
|
EXPOSE 3000
|
|
|
|
# Start application
|
|
CMD ["npm", "start"]
|