# Build stage FROM node:20-alpine AS build WORKDIR /app RUN corepack enable && corepack prepare pnpm@10.31.0 --activate ARG VITE_WS_URL COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ COPY tsconfig.base.json ./ COPY shared/package.json shared/ COPY server/package.json server/ COPY web/package.json web/ RUN pnpm install --frozen-lockfile COPY shared/ shared/ COPY web/ web/ RUN pnpm --filter @anydrop/shared run build \ && test -f shared/dist/index.d.ts \ && rm -rf web/node_modules/@anydrop/shared \ && mkdir -p web/node_modules/@anydrop/shared \ && cp -r shared/package.json shared/dist web/node_modules/@anydrop/shared/ \ && pnpm --filter @anydrop/web exec vite build # Runtime stage FROM nginx:alpine COPY web/nginx.conf /etc/nginx/conf.d/default.conf COPY --from=build /app/web/dist /usr/share/nginx/html EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]