brackt/Dockerfile
Chris Parsons 36db8f73ca
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 2m26s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Successful in 1m23s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
Optimize CI pipeline: merge check jobs, remove docker install, improve layer caching
- Merge typecheck + lint into a single `check` job to eliminate one full
  job lifecycle and one npm ci invocation (~2-4 min savings)
- Remove `apt-get install docker.io` step — Docker CLI and buildx v0.23.0
  are now pre-installed in the custom brackt-runner:latest image
- Reorder Dockerfile build-env COPY layers so node_modules and config
  files are copied before source, improving registry cache hit granularity
- Expand .dockerignore to exclude .forgejo, .git, docs, plans, cypress,
  logs, .env files, and tsbuildinfo files from the build context

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 21:37:01 -07:00

32 lines
No EOL
1.1 KiB
Docker

FROM node:20-alpine AS development-dependencies-env
COPY package.json package-lock.json /app/
WORKDIR /app
RUN --mount=type=secret,id=npmrc,target=/app/.npmrc npm ci
FROM node:20-alpine AS production-dependencies-env
COPY ./package.json package-lock.json /app/
WORKDIR /app
RUN --mount=type=secret,id=npmrc,target=/app/.npmrc npm ci --omit=dev
FROM node:20-alpine AS build-env
WORKDIR /app
COPY --from=development-dependencies-env /app/node_modules /app/node_modules
COPY package.json package-lock.json tsconfig*.json vite.config.ts react-router.config.ts drizzle.config.ts ./
COPY scripts/ /app/scripts/
COPY app/ /app/app/
COPY server/ /app/server/
COPY database/ /app/database/
COPY public/ /app/public/
COPY instrument.server.mjs ./
RUN npm run build
FROM node:20-alpine
COPY ./package.json package-lock.json /app/
COPY --from=production-dependencies-env /app/node_modules /app/node_modules
COPY --from=build-env /app/build /app/build
COPY --from=build-env /app/dist /app/dist
COPY ./drizzle /app/drizzle
COPY ./scripts /app/scripts
COPY ./instrument.server.mjs /app/instrument.server.mjs
WORKDIR /app
CMD ["npm", "run", "start"]