build: static export + ghcr.io/hanzoai/spa runner

This commit is contained in:
2026-04-18 23:52:23 -07:00
parent 75ba7137fb
commit 132d219de9
2 changed files with 8 additions and 29 deletions
+6 -28
View File
@@ -1,31 +1,9 @@
# Lux Market - Next.js 15 Standalone Dockerfile
FROM node:22-alpine AS builder
RUN apk add --no-cache libc6-compat
RUN npm install -g pnpm
FROM node:22-alpine AS build
RUN corepack enable
WORKDIR /app
COPY package.json pnpm-lock.yaml* ./
RUN pnpm install --frozen-lockfile || pnpm install --no-frozen-lockfile
COPY . .
ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_ENV=production
RUN pnpm exec next build
RUN pnpm install --frozen-lockfile || pnpm install
RUN pnpm build
# Runner
FROM node:22-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]
FROM ghcr.io/hanzoai/spa
COPY --from=build /app/out /public
+2 -1
View File
@@ -2,10 +2,11 @@ import path from 'path'
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
output: 'standalone',
output: 'export',
outputFileTracingRoot: path.resolve(import.meta.dirname ?? __dirname),
reactStrictMode: true,
images: {
unoptimized: true,
remotePatterns: [
{ protocol: 'https', hostname: '*.lux.network' },
{ protocol: 'https', hostname: 'ipfs.io' },