32 lines
1.0 KiB
Docker
32 lines
1.0 KiB
Docker
# Pre-requisite: run ./scripts/docker-prep.sh to pack @bytelyst/* tarballs
|
|
# ── Stage 1: Install ──────────────────────────────────
|
|
FROM node:22-alpine AS builder
|
|
WORKDIR /app/web
|
|
RUN npm config set strict-ssl false
|
|
COPY web/package.json ./package.json
|
|
COPY web/.docker-deps/ ./.docker-deps/
|
|
RUN npm install --legacy-peer-deps
|
|
|
|
COPY web/ ./
|
|
COPY shared/ ../shared/
|
|
|
|
# Dummy env vars for Next.js build-time page data collection
|
|
ENV NEXT_PUBLIC_BACKEND_URL=http://localhost:4016
|
|
ENV NEXT_PUBLIC_PLATFORM_URL=http://localhost:4003
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
RUN npm run build
|
|
|
|
# ── Stage 3: Runtime ──────────────────────────────────
|
|
FROM node:22-alpine AS runtime
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
COPY --from=builder /app/web/.next/standalone ./
|
|
COPY --from=builder /app/web/.next/static ./.next/static
|
|
|
|
EXPOSE 3000
|
|
|
|
CMD ["node", "server.js"]
|