mirror of
https://github.com/oxynote/oxynote.git
synced 2026-10-17 19:09:19 +02:00
44 lines
1.4 KiB
Docker
44 lines
1.4 KiB
Docker
FROM node:24.19.0-alpine AS base
|
|
|
|
FROM base AS builder
|
|
|
|
# the lezer-promql build script is a bash script; alpine only ships ash
|
|
RUN apk add --no-cache bash
|
|
RUN npm install -g pnpm
|
|
WORKDIR /app
|
|
|
|
# the vite client build exceeds node's default ~2GB heap
|
|
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
|
|
|
# dependencies come from the manifests alone, so this layer survives every
|
|
# change that does not touch them — which is what makes a rebuild after an
|
|
# ordinary source edit cheap. Scripts are skipped here because the root
|
|
# `prepare` builds the promql grammar and runs `nuxt prepare`, and neither
|
|
# has its sources at this point.
|
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
|
COPY packages/lezer-promql/package.json ./packages/lezer-promql/
|
|
RUN pnpm install --frozen-lockfile --ignore-scripts
|
|
|
|
COPY . .
|
|
|
|
# the dependency tree is already in place, so this install only runs the
|
|
# scripts skipped above (`prepare`, and the allowBuilds native packages).
|
|
# The node-server preset produces a self-contained SSR server in .output
|
|
# that reads NUXT_PUBLIC_* / NUXT_* runtime config from env at startup.
|
|
RUN pnpm install --frozen-lockfile && \
|
|
NITRO_PRESET=node-server pnpm run build:web
|
|
|
|
FROM base AS runner
|
|
WORKDIR /app
|
|
|
|
RUN addgroup --system --gid 1001 nodejs
|
|
RUN adduser --system --uid 1001 nuxt
|
|
|
|
COPY --from=builder --chown=nuxt:nodejs /app/.output /app/.output
|
|
|
|
ENV NODE_ENV=production
|
|
USER nuxt
|
|
EXPOSE 3000
|
|
|
|
CMD ["node", "/app/.output/server/index.mjs"]
|