20 lines
486 B
Docker
20 lines
486 B
Docker
#Dockerfile
|
|
# --- Etapa 1: Build ---
|
|
FROM node:20-alpine AS build
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# --- Etapa 2: Producción ---
|
|
FROM nginx:1.25-alpine
|
|
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
|
|
# Copia la configuración de Nginx al contenedor del frontend
|
|
COPY frontend.nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|
|
# El CMD es opcional ya que la imagen base lo tiene, pero no hace daño
|
|
CMD ["nginx", "-g", "daemon off;"] |