Agregar docker-compose y Dockerfiles para EasyPanel

This commit is contained in:
Panchito
2026-07-22 10:24:58 -05:00
parent 9cc2d28b9a
commit 122dee2d90
6 changed files with 120 additions and 0 deletions

22
frontend/Dockerfile Normal file
View File

@@ -0,0 +1,22 @@
# --- Etapa 1: build de la app React/Vite ---
FROM node:20-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
# VITE_API_URL debe pasarse como build-arg / env en el momento del build,
# ya que Vite la "quema" dentro del bundle estatico.
ARG VITE_API_URL
ENV VITE_API_URL=$VITE_API_URL
RUN npm run build
# --- Etapa 2: servir los archivos estaticos 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