feat: add Dockerfile for documentation service
Introduce a multi-stage Dockerfile for the documentation service to enable efficient builds and optimized runtime with Node.js 22.
This commit is contained in:
22
documentation/Dockerfile
Normal file
22
documentation/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
FROM node:22-slim AS base
|
||||||
|
ENV PNPM_HOME="/pnpm"
|
||||||
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
RUN corepack enable
|
||||||
|
|
||||||
|
FROM base AS build
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
COPY . .
|
||||||
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||||
|
RUN pnpm run --filter @memegoat/documentation build
|
||||||
|
|
||||||
|
FROM base AS runtime
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=build /usr/src/app/documentation/public ./documentation/public
|
||||||
|
COPY --from=build /usr/src/app/documentation/.next/standalone ./
|
||||||
|
COPY --from=build /usr/src/app/documentation/.next/static ./documentation/.next/static
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
ENV PORT=3000
|
||||||
|
ENV HOSTNAME="0.0.0.0"
|
||||||
|
|
||||||
|
CMD ["node", "documentation/server.js"]
|
||||||
Reference in New Issue
Block a user