Files
explore/Dockerfile.lux
T
zeekay cda4e3c4e8 Add node-datachannel stub with polyfill subpath for next build
@libp2p/webrtc imports @ipshipyard/node-datachannel/polyfill which
requires native C++ compilation. Stub provides ESM+CJS exports for
both main and polyfill subpaths with no-op WebRTC classes. Also
ignores pnpm-lock.yaml in cspell and copies stubs dir in Dockerfiles.
2026-02-24 18:07:34 -08:00

67 lines
1.3 KiB
Docker

# Build stage
FROM node:22.14.0-alpine AS builder
RUN apk add --no-cache libc6-compat python3 make g++ git
RUN corepack enable && corepack prepare [email protected] --activate
WORKDIR /app
# Copy package files
COPY package.json pnpm-lock.yaml .npmrc ./
COPY stubs ./stubs
COPY tsconfig.json ./
COPY next.config.js ./
# Copy necessary directories
COPY types ./types
COPY lib ./lib
COPY configs ./configs
COPY toolkit ./toolkit
COPY ui ./ui
COPY pages ./pages
COPY nextjs ./nextjs
COPY theme ./theme
COPY icons ./icons
COPY mocks ./mocks
COPY playwright ./playwright
COPY deploy ./deploy
COPY public ./public
COPY stubs ./stubs
# Copy environment file
COPY .env.production .env.local
# Install dependencies
RUN pnpm install --frozen-lockfile
# Build the application
ENV NODE_OPTIONS="--max-old-space-size=8192"
RUN pnpm build
# Production stage
FROM node:22.14.0-alpine AS runner
RUN apk add --no-cache --upgrade bash curl jq unzip
WORKDIR /app
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
# Copy built application
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
# Set permissions
RUN chown -R nextjs:nodejs /app
USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV NODE_ENV=production
CMD ["node", "server.js"]