24 lines
487 B
Docker
Raw Normal View History

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
# ---------- copy source & build -----
2025-07-21 22:28:31 +02:00
WORKDIR /usr/src/app
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
# ② compile TypeScript
2025-07-21 22:28:31 +02:00
RUN npm run build
# ③ 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 /