From 8bbbaa1ea4c254438f17cdf378475c563c54cea4 Mon Sep 17 00:00:00 2001 From: govardhan Date: Thu, 19 Jun 2025 20:31:02 +0530 Subject: [PATCH] docker config added --- Dockerfile | 34 ++++++++++++++++++++++++++++++++ docker-compose.yml | 21 ++++++++++++++++++++ site_name: backup.yml.backyp.yml | 2 ++ 3 files changed, 57 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b9b0649 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +# Build stage +FROM python:3.9-slim AS builder + +# Install MkDocs, Material for MkDocs, and plugins +RUN pip install --no-cache-dir mkdocs mkdocs-material mkdocs-macros-plugin + +# Set working directory +WORKDIR /docs + +# Copy configuration and docs +COPY mkdocs.yml . +COPY docs/ ./docs/ + +# Validate configuration and build site with strict mode +RUN mkdocs build --strict + +# Production stage +FROM nginx:alpine + +# Copy the built site from the builder stage +COPY --from=builder /docs/site /usr/share/nginx/html + +# Copy custom Nginx configuration +COPY nginx.conf /etc/nginx/conf.d/default.conf + +# Expose port 80 +EXPOSE 80 + +# Healthcheck to ensure Nginx is running +HEALTHCHECK --interval=30s --timeout=3s \ + CMD curl -f http://localhost/ || exit 1 + +# Start Nginx +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2bb97bc --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +version: '3.9' + +services: + mkdocs: + build: + context: . + dockerfile: Dockerfile + image: mkdocs-material-prod + ports: + - "8085:80" + environment: + - NGINX_WORKER_PROCESSES=1 + - NGINX_WORKER_CONNECTIONS=1024 + volumes: + - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro + restart: unless-stopped + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost/"] + interval: 30s + timeout: 3s + retries: 3 \ No newline at end of file diff --git a/site_name: backup.yml.backyp.yml b/site_name: backup.yml.backyp.yml index f56125b..cdd807f 100644 --- a/site_name: backup.yml.backyp.yml +++ b/site_name: backup.yml.backyp.yml @@ -232,6 +232,8 @@ nav: - Release Notes: - Overview: releasenotes/releasenotes.html.md - Release Notes: releasenotes/releasenotes.html.md + + # Markdown extensions markdown_extensions: - admonition