2026-07-07 21:36:43 +02:00
|
|
|
FROM node:22-alpine AS build
|
|
|
|
|
WORKDIR /app
|
2026-07-10 15:40:57 +02:00
|
|
|
# better-sqlite3 has a native addon with no prebuilt binary for this
|
|
|
|
|
# platform/Node combo yet — build it from source.
|
|
|
|
|
RUN apk add --no-cache python3 make g++
|
2026-07-07 21:36:43 +02:00
|
|
|
COPY package*.json ./
|
|
|
|
|
RUN npm install
|
|
|
|
|
COPY . .
|
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
|
|
FROM node:22-alpine
|
|
|
|
|
WORKDIR /app
|
2026-07-10 15:40:57 +02:00
|
|
|
# Same native-addon rebuild needed for the production-only install below;
|
|
|
|
|
# the toolchain is purged again afterward to keep the runtime image lean.
|
|
|
|
|
RUN apk add --no-cache python3 make g++
|
2026-07-07 21:36:43 +02:00
|
|
|
COPY package*.json ./
|
2026-07-10 15:40:57 +02:00
|
|
|
RUN npm install --omit=dev && apk del python3 make g++
|
2026-07-07 21:36:43 +02:00
|
|
|
COPY --from=build /app/dist ./dist
|
2026-07-19 19:50:36 +02:00
|
|
|
COPY --from=build /app/public ./public
|
2026-07-10 15:40:57 +02:00
|
|
|
|
|
|
|
|
# DATA_DIR (SQLite DB) is a mutable runtime volume — not baked into the
|
|
|
|
|
# image, so redeploys don't clobber host overrides / manual targets.
|
|
|
|
|
ENV DATA_DIR=/app/data
|
|
|
|
|
|
2026-07-07 21:36:43 +02:00
|
|
|
EXPOSE 3035
|
|
|
|
|
CMD ["node", "dist/index.js"]
|