fix(build): Added npm build in dockerfile

This commit is contained in:
l-nmch
2025-10-26 12:08:42 +01:00
parent ecf60cfb5d
commit 54ecbcfba2

View File

@@ -1,3 +1,10 @@
FROM node:14.0-slim AS appjs-builder
WORKDIR /app
COPY app/package.json app/package-lock.json ./
RUN npm install
COPY app .
RUN npm run build
FROM python:3.11-slim FROM python:3.11-slim
WORKDIR / WORKDIR /
@@ -23,6 +30,9 @@ WORKDIR /
# copy pre-built packages to this image # copy pre-built packages to this image
COPY --from=0 /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages COPY --from=0 /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
# Copy the built JS files from the appjs-builder stage
COPY --from=appjs-builder /app/static/build /kube_ops_view/static/build
# now copy the actual code we will execute (poetry install above was just for dependencies) # now copy the actual code we will execute (poetry install above was just for dependencies)
COPY kube_ops_view /kube_ops_view COPY kube_ops_view /kube_ops_view