Files
Elecciones-2025/Elecciones-Web/frontend/Dockerfile

19 lines
474 B
Docker
Raw Normal View History

2025-09-03 17:38:05 -03:00
# --- Etapa 1: Build ---
2025-08-15 17:41:04 -03:00
FROM node:20-alpine AS build
WORKDIR /app
2025-09-03 17:38:05 -03:00
COPY package*.json ./
2025-08-15 17:41:04 -03:00
RUN npm install
COPY . .
RUN npm run build
2025-09-03 17:38:05 -03:00
# --- Etapa 2: Producción ---
2025-08-15 17:41:04 -03:00
FROM nginx:1.25-alpine
COPY --from=build /app/dist /usr/share/nginx/html
2025-09-03 17:38:05 -03:00
# Copia la configuración de Nginx al contenedor del frontend
2025-09-03 14:16:18 -03:00
COPY frontend.nginx.conf /etc/nginx/conf.d/default.conf
2025-08-15 17:41:04 -03:00
2025-09-03 17:38:05 -03:00
EXPOSE 80
# El CMD es opcional ya que la imagen base lo tiene, pero no hace daño
CMD ["nginx", "-g", "daemon off;"]