Compare commits
2 Commits
161a1fec3d
...
b6a0950565
| Author | SHA1 | Date | |
|---|---|---|---|
| b6a0950565 | |||
| 050bd55bc1 |
13
Dockerfile
13
Dockerfile
@@ -20,12 +20,10 @@ RUN cd client && npm run build
|
|||||||
|
|
||||||
# ─────────────────────────────────────────────────────────────────────────────
|
# ─────────────────────────────────────────────────────────────────────────────
|
||||||
# Stage 2: Production image
|
# Stage 2: Production image
|
||||||
# Copies only what's needed to run — no dev tools, no node_modules for client.
|
|
||||||
# Final image is lean (~180MB) and ready to run with zero host setup.
|
|
||||||
# ─────────────────────────────────────────────────────────────────────────────
|
# ─────────────────────────────────────────────────────────────────────────────
|
||||||
FROM node:20-alpine AS production
|
FROM node:20-alpine AS production
|
||||||
|
|
||||||
# Chromium + deps for Phase 3 Puppeteer PDF generation
|
# Chromium for Puppeteer PDF generation
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
chromium \
|
chromium \
|
||||||
nss \
|
nss \
|
||||||
@@ -42,16 +40,17 @@ ENV DB_PATH=/data/cpas.db
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy backend deps from builder
|
# Copy backend node_modules and compiled frontend from builder
|
||||||
COPY --from=builder /build/node_modules ./node_modules
|
COPY --from=builder /build/node_modules ./node_modules
|
||||||
COPY --from=builder /build/client/dist ./client/dist
|
COPY --from=builder /build/client/dist ./client/dist
|
||||||
|
|
||||||
# Copy backend source
|
# Copy all backend source files
|
||||||
COPY server.js ./
|
COPY server.js ./
|
||||||
COPY db/ ./db/
|
|
||||||
COPY package.json ./
|
COPY package.json ./
|
||||||
|
COPY db/ ./db/
|
||||||
|
COPY pdf/ ./pdf/
|
||||||
|
|
||||||
# Ensure data directory exists (will be overridden by volume mount)
|
# Ensure data directory exists
|
||||||
RUN mkdir -p /data
|
RUN mkdir -p /data
|
||||||
|
|
||||||
EXPOSE 3001
|
EXPOSE 3001
|
||||||
|
|||||||
Reference in New Issue
Block a user