|
|
|
@ -3,15 +3,24 @@ |
|
|
|
|
|
|
|
FROM docker.io/library/node:18-alpine AS build_node_modules |
|
|
|
|
|
|
|
# Copy Web UI |
|
|
|
COPY src/ /app/ |
|
|
|
WORKDIR /app |
|
|
|
# Copy Web UI source and build static files |
|
|
|
COPY webui/ /webui/ |
|
|
|
WORKDIR /webui |
|
|
|
RUN npm ci |
|
|
|
RUN npm run build |
|
|
|
|
|
|
|
# Copy server, install requirements |
|
|
|
COPY src/ /server/ |
|
|
|
WORKDIR /server |
|
|
|
RUN npm ci --omit=dev |
|
|
|
|
|
|
|
# Copy build result to a new image. |
|
|
|
# This saves a lot of disk space. |
|
|
|
FROM docker.io/library/node:18-alpine |
|
|
|
COPY --from=build_node_modules /app /app |
|
|
|
|
|
|
|
# Copy the server files and the built static files |
|
|
|
COPY --from=build_node_modules /server /app |
|
|
|
COPY --from=build_node_modules /webui/dist /app/www |
|
|
|
|
|
|
|
# Move node_modules one directory up, so during development |
|
|
|
# we don't have to mount it in a volume. |
|
|
|
|