31 lines
620 B
Docker
31 lines
620 B
Docker
FROM node:18-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copiar archivos de dependencias
|
|
COPY package.json package-lock.json* ./
|
|
|
|
# Instalar dependencias
|
|
RUN npm ci
|
|
|
|
# Copiar código fuente
|
|
COPY . .
|
|
|
|
# Construir aplicación Astro
|
|
RUN npm run build
|
|
|
|
# Stage de producción - servir con nginx
|
|
FROM nginx:alpine
|
|
|
|
# Copiar archivos construidos
|
|
COPY --from=builder /app/dist /usr/share/nginx/html/landing
|
|
|
|
#change /usr/share/nginx/html to /usr/share/nginx/html/landing
|
|
RUN sed -i 's|/usr/share/nginx/html|/usr/share/nginx/html/landing|g' /etc/nginx/conf.d/default.conf
|
|
|
|
# Exponer puerto
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|
|
|