# Stage 1: Base Nginx static server
FROM nginx:1.27-alpine

# Metadata
LABEL maintainer="Aetoskia <dev@aetoskia.com>"
LABEL description="Static documentation host for Aetoskia projects"

# Copy custom Nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf

# Copy all project docs
# Expected folder layout (on build context):
COPY ./_index /usr/share/nginx/html/
COPY ./mongo-ops/site /usr/share/nginx/html/mongo-ops/
COPY ./blog-api/site /usr/share/nginx/html/api/blog/

# Expose HTTP port
EXPOSE 80

# Healthcheck
HEALTHCHECK --interval=30s --timeout=5s CMD wget -qO- http://localhost/ || exit 1

# Start Nginx
CMD ["nginx", "-g", "daemon off;"]
