diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 0fce608..fed5a90 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,26 +1,13 @@ -# syntax=docker/dockerfile:1 - -# ===== STAGE 1: Build ===== -FROM node:22-alpine AS builder - -RUN corepack enable && corepack prepare pnpm@latest --activate +FROM node:20-alpine AS build WORKDIR /app - -COPY package.json pnpm-lock.yaml ./ -RUN --mount=type=cache,id=pnpm-marketplace,target=/pnpm/store \ - pnpm install --frozen-lockfile - +COPY package*.json ./ +RUN npm install COPY . . -RUN pnpm build +RUN npm run build -# ===== STAGE 2: Production (static-web-server ~3MB binary) ===== -FROM docker.io/joseluisq/static-web-server:2-alpine - -COPY --from=builder /app/dist /public - -# SPA mode: fallback para index.html -ENV SERVER_FALLBACK_PAGE=/public/index.html -ENV SERVER_ROOT=/public -ENV SERVER_PORT=3000 - -EXPOSE 3000 +FROM node:20-alpine +WORKDIR /app +RUN npm install -g serve +COPY --from=build /app/dist ./dist +EXPOSE 8080 +CMD ["serve", "-s", "dist", "-l", "8080"]