18 lines
575 B
Text
18 lines
575 B
Text
# Build-only image for the Vue frontend.
|
|
# It is never run as a service: ansible builds this image once, runs it
|
|
# with the host output directory bind-mounted at /output, the container
|
|
# copies the compiled static build into it, and exits. Nginx on the host
|
|
# then serves that directory directly.
|
|
|
|
FROM node:20-alpine AS build
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
COPY extras/ ./extras/
|
|
RUN npm ci
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
FROM alpine AS export
|
|
COPY --from=build /app/dist /dist
|
|
VOLUME /output
|
|
CMD ["sh", "-c", "rm -rf /output/* && cp -a /dist/. /output/"]
|