# Frontend Dockerfile for Vue/Vite TypeScript project FROM node:24-alpine AS deps WORKDIR /app COPY frontend/package.json frontend/yarn.lock frontend/.yarnrc.yml ./ COPY frontend/.yarn/releases/ ./.yarn/releases/ RUN set -eux; \ retry() { \ attempts="$1"; shift; \ n=1; \ while [ "$n" -le "$attempts" ]; do \ if "$@"; then \ return 0; \ fi; \ if [ "$n" -lt "$attempts" ]; then \ sleep "$((3 * n))"; \ fi; \ n=$((n + 1)); \ done; \ return 1; \ }; \ YARN_CLI="$(ls .yarn/releases/yarn-*.cjs | head -n 1)"; \ if [ -z "${YARN_CLI}" ]; then \ echo "Missing vendored Yarn release in .yarn/releases"; \ exit 1; \ fi; \ retry 5 node "${YARN_CLI}" install --immutable FROM deps AS build COPY frontend/ . RUN node .yarn/releases/yarn-4.10.3.cjs build FROM nginx:alpine AS production COPY --from=build /app/dist /usr/share/nginx/html COPY frontend/nginx.conf /etc/nginx/nginx.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]