mirror of
https://github.com/adrianjagielak/home-assistant-futurehome.git
synced 2025-11-18 09:09:03 +00:00
Do not include dev npm packages in final image
This commit is contained in:
@@ -4,12 +4,20 @@ FROM ${BUILD_FROM}
|
||||
# ---------- install NodeJS ----------
|
||||
RUN apk add --no-cache nodejs npm python3 make g++
|
||||
|
||||
# ---------- copy source -------------
|
||||
# ---------- copy source & build -----
|
||||
WORKDIR /usr/src/app
|
||||
COPY package.json tsconfig.json ./
|
||||
RUN npm install
|
||||
COPY package.json package-lock.json tsconfig.json ./
|
||||
|
||||
# ① install EVERYTHING (prod + dev)
|
||||
RUN npm ci
|
||||
|
||||
COPY src ./src
|
||||
|
||||
# ② compile TypeScript
|
||||
RUN npm run build
|
||||
|
||||
# ③ throw dev stuff away so the final image stays small
|
||||
RUN npm prune --omit=dev
|
||||
|
||||
# ---------- copy s6 service files ---
|
||||
COPY rootfs /
|
||||
|
||||
Reference in New Issue
Block a user