mirror of
https://github.com/horizon-rust/horizon-site.git
synced 2026-11-07 10:05:58 -10:00
The image now holds Next's standalone server (82 MB) with the static files, public, content and assets it reads at run time, instead of the whole app and its 476 MB of node_modules.
22 lines
686 B
Docker
22 lines
686 B
Docker
FROM node:24-bookworm-slim AS build
|
|
WORKDIR /app
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
COPY . .
|
|
ARG GITHUB_TOKEN
|
|
RUN npm run build
|
|
|
|
FROM node:24-bookworm-slim
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production NEXT_TELEMETRY_DISABLED=1 PORT=8080 HOSTNAME=0.0.0.0
|
|
COPY --from=build --chown=node:node /app/.next/standalone ./
|
|
COPY --from=build --chown=node:node /app/.next/static ./.next/static
|
|
COPY --from=build --chown=node:node /app/public ./public
|
|
COPY --from=build --chown=node:node /app/content ./content
|
|
COPY --from=build --chown=node:node /app/assets ./assets
|
|
RUN mkdir -p .data && chown node:node .data
|
|
USER node
|
|
EXPOSE 8080
|
|
CMD ["node", "server.js"]
|