Ctrl K
ComunidadGuías…

Dockerfile-website

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
# Inkverse website (React Router 7 + Vite, SSR) in a Yarn Classic workspaces monorepo.
# Build context is the MONOREPO ROOT so @inkverse/public and @inkverse/shared-client resolve.
# Copilot: copilot/website/manifest.yml builds this with context = repo root, port 3000.
FROM node:24.22-slim AS build
WORKDIR /app
RUN corepack enable

# Copy manifests first for better layer caching, then install from the ROOT lockfile.
COPY package.json yarn.lock ./
COPY packages/public/package.json ./packages/public/package.json
COPY packages/shared-client/package.json ./packages/shared-client/package.json
COPY website/package.json ./website/package.json
RUN yarn install --frozen-lockfile

# Copy sources and build in dependency order (public -> shared-client -> website).
COPY packages/public/ ./packages/public/
COPY packages/shared-client/ ./packages/shared-client/
COPY website/ ./website/
ENV NODE_ENV=production

WORKDIR /app/packages/public
RUN yarn build
WORKDIR /app/packages/shared-client
RUN yarn build
WORKDIR /app/website
RUN yarn build

# --- runtime image ---
FROM node:24.22-slim AS runtime
WORKDIR /app/website
ENV NODE_ENV=production
ENV PORT=3000
RUN corepack enable

# Keep the full workspace tree so hoisted node_modules + the @inkverse/* symlink
# targets (packages/*/dist) stay valid and `yarn start` (uses cross-env) works.
COPY --from=build /app /app

EXPOSE 3000
CMD ["yarn", "start"]