-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (28 loc) · 830 Bytes
/
Copy pathDockerfile
File metadata and controls
40 lines (28 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# LegalBot RAG - Production Dockerfile
FROM node:20-slim AS builder
WORKDIR /app
# Install dependencies
COPY package.json pnpm-lock.yaml* ./
RUN npm install -g pnpm && pnpm install --frozen-lockfile
# Copy source and build
COPY . .
RUN pnpm build
# Production image
FROM node:20-slim AS runner
WORKDIR /app
ENV NODE_ENV=production
# Install pnpm for production deps
RUN npm install -g pnpm
# Copy package files
COPY package.json pnpm-lock.yaml* ./
RUN pnpm install --prod --frozen-lockfile
# Copy built files, static assets, and data
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/src/public ./dist/public
COPY --from=builder /app/data ./data
# Create non-root user
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 legalbot
USER legalbot
EXPOSE 3000
CMD ["node", "dist/index.js"]