Files

31 lines
1.1 KiB
Docker

# syntax=docker/dockerfile:1
# WhatsApp API Mockup - sitio estático servido por nginx (puerto 80).
# Coolify: build pack "dockerfile", ports_exposes=80.
# Etapa 1: reunir solo lo publicable. El contexto ya viene filtrado por
# .dockerignore (allowlist); aquí se copia docs/capturas únicamente si existe,
# para que el build no falle cuando la carpeta no está.
FROM nginx:stable-alpine AS site
WORKDIR /src
COPY . .
RUN set -eux; \
mkdir -p /out; \
cp index.html /out/; \
cp -R css js /out/; \
if [ -d docs/capturas ]; then mkdir -p /out/docs && cp -R docs/capturas /out/docs/; fi; \
find /out -type d -exec chmod 0755 {} +; \
find /out -type f -exec chmod 0644 {} +
# Etapa 2: imagen final.
FROM nginx:stable-alpine
RUN rm -f /etc/nginx/conf.d/*.conf /usr/share/nginx/html/*
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=site /out/ /usr/share/nginx/html/
RUN nginx -t
EXPOSE 80
# Endpoint /healthz definido en nginx.conf (sin dependencias).
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
CMD wget -q -O /dev/null http://127.0.0.1/healthz || exit 1