feat: reestructuracion para easypanel y variables de entorno

This commit is contained in:
desoladorxx
2026-07-20 17:22:50 -05:00
commit 7f38210017
45 changed files with 8219 additions and 0 deletions

24
frontend/Dockerfile Normal file
View File

@@ -0,0 +1,24 @@
# Etapa 1: Compilación de la aplicación de React + Vite
FROM node:20-alpine AS builder
WORKDIR /app
# Recibir la variable de entorno VITE_API_URL en tiempo de construcción (build arg)
ARG VITE_API_URL
ENV VITE_API_URL=$VITE_API_URL
# Copiar los manifiestos de dependencias e instalarlas
COPY package*.json ./
RUN npm ci
# Copiar el código fuente y compilar el proyecto
COPY . .
RUN npm run build
# Etapa 2: Servir los archivos estáticos usando Nginx
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]