brackt/Dockerfile
Chris Parsons ac22ff3a12
All checks were successful
🚀 Deploy / 🧪 Test (push) Successful in 2m28s
🚀 Deploy / ʦ🔍 Typecheck & Lint (push) Successful in 1m23s
🚀 Deploy / 🐳 Build (push) Successful in 2m38s
🚀 Deploy / 🚀 Deploy (push) Successful in 10s
Fix Docker build: copy root server.ts into build-env stage
The build:server script (esbuild) expects server.ts at the working
directory root, but the Dockerfile only copied the server/ directory.

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

33 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 ./
COPY server.ts ./
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"]