forked from AgoraDMV/BillTrax
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (37 loc) · 2.32 KB
/
Copy pathDockerfile
File metadata and controls
41 lines (37 loc) · 2.32 KB
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
41
# ── base ─────────────────────────────────────────────────────────────────────
# mysql2 is pure JS — no native build tools needed
# python3 is stdlib-only for DeltaTrack diff engine (no pip needed)
FROM node:24-alpine AS base
WORKDIR /app
RUN apk add --no-cache python3 curl
# ── deps ─────────────────────────────────────────────────────────────────────
# Use npm install (not npm ci) so Docker-only workflows can add packages via
# package.json without needing to regenerate the lock file on the host.
FROM base AS deps
COPY package.json ./
RUN npm install
# ── ci / dev ─────────────────────────────────────────────────────────────────
# Source baked in — used for dev server, typecheck, and tests.
# docker compose watch syncs changes from host into /app/src and /app/public.
FROM deps AS ci
COPY . .
EXPOSE 3000
CMD ["npm", "run", "dev"]
# ── build ────────────────────────────────────────────────────────────────────
FROM ci AS build
RUN npm run build
# ── runtime ──────────────────────────────────────────────────────────────────
# DeltaTrack diff_service.py + vendored Python engine for inline diff requests.
# Background diffs are primarily handled by diff-worker (ci stage), but the web
# container may still spawn Python for uncached compare requests.
FROM node:24-alpine AS runtime
WORKDIR /app
RUN apk add --no-cache python3
ENV NODE_ENV=production
COPY --from=build /app/.next/standalone ./
COPY --from=build /app/.next/static ./.next/static
COPY --from=build /app/public ./public
COPY --from=build /app/scripts/diff_service.py ./scripts/diff_service.py
COPY --from=build /app/submodules/DeltaTrack ./submodules/DeltaTrack
EXPOSE 3000
CMD ["node", "server.js"]