2026-08-24 08:56:48 -07:00
|
|
|
FROM node:24.18.0-slim
|
2025-10-11 13:27:50 +01:00
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
2026-03-09 11:18:22 +01:00
|
|
|
# Keep install non-interactive and deterministic in CI/container contexts.
|
|
|
|
|
ENV CI=true
|
2026-06-23 10:17:09 +01:00
|
|
|
ENV PNPM_HOME="/pnpm"
|
|
|
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
2025-10-11 13:27:50 +01:00
|
|
|
|
2026-03-09 11:18:22 +01:00
|
|
|
RUN corepack enable && corepack prepare pnpm@10.19.0 --activate
|
2025-10-11 13:27:50 +01:00
|
|
|
|
2026-06-23 10:17:09 +01:00
|
|
|
# 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
|
|
|
|
|
|
2025-10-11 13:27:50 +01:00
|
|
|
COPY . .
|
|
|
|
|
|
2026-06-23 10:17:09 +01:00
|
|
|
RUN pnpm install --offline --frozen-lockfile --ignore-scripts --shamefully-hoist \
|
|
|
|
|
--store-dir /pnpm/store --filter @cio/api...
|
2026-03-09 11:18:22 +01:00
|
|
|
RUN find . -name 'tsconfig.tsbuildinfo' -delete
|
|
|
|
|
RUN pnpm -r --filter @cio/api... build
|
2025-10-11 13:27:50 +01:00
|
|
|
|
2026-03-18 23:39:12 +01:00
|
|
|
COPY docker/entrypoint-api.sh /app/entrypoint.sh
|
|
|
|
|
RUN chmod +x /app/entrypoint.sh
|
|
|
|
|
|
2025-10-11 13:27:50 +01:00
|
|
|
EXPOSE 3081
|
|
|
|
|
|
2026-03-09 11:18:22 +01:00
|
|
|
ENV NODE_ENV=production \
|
|
|
|
|
PORT=3081
|
2025-10-11 14:26:14 +01:00
|
|
|
|
2026-03-18 23:39:12 +01:00
|
|
|
ENTRYPOINT ["/app/entrypoint.sh"]
|