Files
classroomio/docker/Dockerfile.dashboard
T

37 lines
1021 B
Docker
Raw Normal View History

2026-03-09 11:18:22 +01:00
FROM node:20.19.3-slim
WORKDIR /app
2026-03-09 11:18:22 +01:00
ENV CI=true
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
2026-03-09 11:18:22 +01:00
ARG PUBLIC_IS_SELFHOSTED=true
2026-03-09 11:18:22 +01:00
RUN corepack enable && corepack prepare pnpm@10.19.0 --activate
# Fetch deps from the lockfile first (cached unless pnpm-lock.yaml changes); the
# store is baked into this layer and reused by the offline install below.
COPY pnpm-lock.yaml ./
RUN pnpm fetch --store-dir /pnpm/store
2026-03-09 11:18:22 +01:00
COPY . .
RUN pnpm install --offline --frozen-lockfile --ignore-scripts \
--store-dir /pnpm/store --filter @cio/dashboard...
2026-03-09 11:18:22 +01:00
RUN find . -name 'tsconfig.tsbuildinfo' -delete
RUN NODE_OPTIONS="--max-old-space-size=8072" \
2026-03-09 11:18:22 +01:00
PUBLIC_IS_SELFHOSTED="${PUBLIC_IS_SELFHOSTED}" \
pnpm -r --filter @cio/dashboard... build
RUN test -f apps/dashboard/build/index.js || (echo "ERROR: Dashboard build output not found at apps/dashboard/build/index.js" && exit 1)
EXPOSE 3000
2026-03-09 11:18:22 +01:00
ENV NODE_ENV=production \
PORT=3000 \
PUBLIC_IS_SELFHOSTED=true
2026-03-09 11:18:22 +01:00
WORKDIR /app/apps/dashboard
CMD ["node", "build/index.js"]