test-diag/apps/web/Dockerfile
jordan 4dbcaea9c4
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Add app-react component: web
2026-02-01 19:34:28 +00:00

35 lines
797 B
Docker

# Build stage - using pnpm for workspace dependency resolution
FROM node:20-alpine AS build
# Install pnpm
RUN npm install -g pnpm
WORKDIR /workspace
# Copy workspace configuration files
COPY pnpm-workspace.yaml package.json pnpm-lock.yaml* ./
# Copy shared packages (required for workspace:* dependencies)
COPY packages/ ./packages/
# Copy the app component
COPY apps/web/ ./apps/web/
# Install dependencies using pnpm (resolves workspace:* correctly)
RUN pnpm install --frozen-lockfile || pnpm install
# Build the app
WORKDIR /workspace/apps/web
RUN pnpm build
# Production stage
FROM nginx:alpine
# Copy built assets
COPY --from=build /workspace/apps/web/dist /usr/share/nginx/html
COPY apps/web/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]