From b0169618584470aacf574230b7c65d9bc828bf02 Mon Sep 17 00:00:00 2001 From: Administrator Date: Sat, 27 Jun 2026 12:46:47 -0500 Subject: [PATCH] Actualizar frontend/Dockerfile --- frontend/Dockerfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index aa03b4c..9411a15 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -4,14 +4,24 @@ FROM node:18-alpine # 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 + +# 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 (dist) +# Copiamos el código y construimos la web (ahora Vite sí verá las variables) COPY . . RUN npm run build -# Instalamos un servidor estático súper ligero y lo ejecutamos +# Instalamos el servidor estático y lo ejecutamos RUN npm install -g serve CMD ["serve", "-s", "dist", "-l", "5173"] \ No newline at end of file