vue-tsc and other workspace devDeps were missing because COPY <workspace>/ ran after yarn install, leaving yarn without sub-package manifests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
33 行
934 B
Docker
33 行
934 B
Docker
# syntax=docker/dockerfile:1.7
|
|
FROM --platform=linux/amd64 node:22-alpine AS build
|
|
WORKDIR /workspace
|
|
|
|
COPY package.json ./package.json
|
|
COPY yarn.lock ./yarn.lock
|
|
# Workspace manifests must exist before yarn install so devDeps are installed
|
|
COPY ops-platform/package.json ./ops-platform/package.json
|
|
|
|
ENV YARN_CACHE_FOLDER=/var/cache/yarn
|
|
|
|
RUN --mount=type=cache,target=/var/cache/yarn,sharing=locked \
|
|
yarn install --frozen-lockfile
|
|
|
|
# GIT_COMMIT invalidates source-code layers on every commit, without re-running yarn install
|
|
ARG GIT_COMMIT=unknown
|
|
COPY ops-platform ./ops-platform
|
|
|
|
ARG OPS_APP_BASE=/
|
|
ARG OPS_API_BASE_URL=/api
|
|
|
|
RUN cd ops-platform && \
|
|
VITE_APP_BASE=${OPS_APP_BASE} \
|
|
VITE_API_BASE_URL=${OPS_API_BASE_URL} \
|
|
yarn build
|
|
|
|
FROM --platform=linux/amd64 nginx:1.27-alpine
|
|
|
|
COPY nginx/ops.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=build /workspace/ops-platform/dist /usr/share/nginx/html
|
|
|
|
EXPOSE 80
|