mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-12 14:05:08 +10:00
70064be7de
- Implement functionality to move items between sections or pages - Enhance custom sections to have a `type` property - Update the v4 importer to account for custom sections - Update healthcheck to be a simple curl command - Update dependencies to latest and a lot more changes
55 lines
1.3 KiB
Docker
55 lines
1.3 KiB
Docker
# syntax=docker/dockerfile:1
|
|
|
|
# ---------- Dependencies Layer ----------
|
|
FROM node:24-slim AS dependencies
|
|
|
|
ENV PNPM_HOME="/pnpm"
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
RUN corepack enable
|
|
|
|
RUN mkdir -p /tmp/dev /tmp/prod
|
|
|
|
COPY package.json pnpm-lock.yaml /tmp/dev/
|
|
COPY package.json pnpm-lock.yaml /tmp/prod/
|
|
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
|
cd /tmp/dev && pnpm install --frozen-lockfile
|
|
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
|
cd /tmp/prod && pnpm install --frozen-lockfile --prod
|
|
|
|
# ---------- Builder Layer ----------
|
|
FROM node:24-slim AS builder
|
|
|
|
ENV PNPM_HOME="/pnpm"
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
RUN corepack enable
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=dependencies /tmp/dev/node_modules ./node_modules
|
|
COPY . .
|
|
|
|
RUN pnpm run build
|
|
|
|
# ---------- Runtime Layer ----------
|
|
FROM node:24-slim AS runtime
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
COPY --from=builder /app/.output ./.output
|
|
COPY --from=builder /app/migrations ./migrations
|
|
COPY --from=dependencies /tmp/prod/node_modules ./node_modules
|
|
|
|
EXPOSE 3000/tcp
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
|
CMD curl -f http://localhost:3000/api/health || exit 1
|
|
|
|
ENTRYPOINT ["node", "-r", "reflect-metadata", ".output/server/index.mjs"]
|