Actualizar dominios a dashboardapi y dashboardv1

This commit is contained in:
Administrator
2026-08-29 12:21:21 -05:00
parent 191b5bb1ba
commit 54581c21ab
77 changed files with 7679 additions and 11728 deletions

View File

@@ -1,27 +1,20 @@
# Usamos Node.js para compilar el proyecto
FROM node:18-alpine
# ── Etapa 1: build del frontend con Vite ──
FROM node:20-alpine AS build
# Creamos la carpeta de trabajo
WORKDIR /app
# Declaramos que recibiremos estos argumentos durante el build
ARG VITE_SUPABASE_URL
ARG VITE_SUPABASE_ANON_KEY
ARG VITE_API_URL
COPY package.json package-lock.json* ./
RUN npm ci --no-audit --no-fund || npm install --no-audit --no-fund
# Los convertimos en variables de entorno para que Vite los vea al compilar
ENV VITE_SUPABASE_URL=$VITE_SUPABASE_URL
ENV VITE_SUPABASE_ANON_KEY=$VITE_SUPABASE_ANON_KEY
ENV VITE_API_URL=$VITE_API_URL
# Copiamos los archivos de configuración e instalamos dependencias
COPY package*.json ./
RUN npm install
# Copiamos el código y construimos la web (ahora Vite sí verá las variables)
COPY . .
RUN npm run build
# Instalamos el servidor estático y lo ejecutamos
RUN npm install -g serve
CMD ["serve", "-s", "dist", "-l", "5173"]
# ── Etapa 2: servir el build con nginx ──
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]