2025-07-21 15:20:40 +02:00
|
|
|
ARG BUILD_FROM
|
2025-07-21 22:28:31 +02:00
|
|
|
FROM ${BUILD_FROM}
|
2025-07-21 15:20:40 +02:00
|
|
|
|
2025-07-21 22:28:31 +02:00
|
|
|
# ---------- install NodeJS ----------
|
|
|
|
RUN apk add --no-cache nodejs npm python3 make g++
|
2025-07-21 15:20:40 +02:00
|
|
|
|
2025-07-21 22:39:48 +02:00
|
|
|
# ---------- copy source & build -----
|
2025-07-21 22:28:31 +02:00
|
|
|
WORKDIR /usr/src/app
|
2025-07-21 22:39:48 +02:00
|
|
|
COPY package.json package-lock.json tsconfig.json ./
|
|
|
|
|
|
|
|
# ① install EVERYTHING (prod + dev)
|
|
|
|
RUN npm ci
|
|
|
|
|
2025-07-21 22:28:31 +02:00
|
|
|
COPY src ./src
|
2025-07-21 22:39:48 +02:00
|
|
|
|
|
|
|
# ② compile TypeScript
|
2025-07-21 22:28:31 +02:00
|
|
|
RUN npm run build
|
|
|
|
|
2025-07-21 22:39:48 +02:00
|
|
|
# ③ throw dev stuff away so the final image stays small
|
|
|
|
RUN npm prune --omit=dev
|
|
|
|
|
2025-07-21 22:28:31 +02:00
|
|
|
# ---------- copy s6 service files ---
|
2025-07-21 15:20:40 +02:00
|
|
|
COPY rootfs /
|