-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (40 loc) · 1.33 KB
/
Dockerfile
File metadata and controls
52 lines (40 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM node:20-slim AS base
# Install dependencies only when needed
FROM base AS deps
WORKDIR /app
# Copy package files and postinstall script
COPY package.json package-lock.json* ./
COPY scripts ./scripts
# Install dependencies (postinstall patches privacycash)
RUN npm ci || npm install
# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Build arguments for Next.js public env vars (must be available at build time)
ARG NEXT_PUBLIC_PRIVY_APP_ID
ARG NEXT_PUBLIC_APP_URL
ARG NEXT_PUBLIC_RPC_URL
ENV NEXT_PUBLIC_PRIVY_APP_ID=$NEXT_PUBLIC_PRIVY_APP_ID
ENV NEXT_PUBLIC_APP_URL=$NEXT_PUBLIC_APP_URL
ENV NEXT_PUBLIC_RPC_URL=$NEXT_PUBLIC_RPC_URL
# Build the application
ENV NEXT_TELEMETRY_DISABLED=1
RUN npm run build
# Production image
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
# Copy standalone output (includes minimal node_modules)
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/public ./public
# Copy privacycash circuit files (WASM and zkey for ZK proofs)
COPY --from=builder /app/node_modules/privacycash ./node_modules/privacycash
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
# Run standalone server directly
CMD ["node", "server.js"]