docker config added

This commit is contained in:
govardhan
2025-06-19 20:31:02 +05:30
parent d43218fe31
commit 8bbbaa1ea4
3 changed files with 57 additions and 0 deletions

34
Dockerfile Normal file
View File

@ -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;"]

21
docker-compose.yml Normal file
View File

@ -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

View File

@ -232,6 +232,8 @@ nav:
- Release Notes:
- Overview: releasenotes/releasenotes.html.md
- Release Notes: releasenotes/releasenotes.html.md
# Markdown extensions
markdown_extensions:
- admonition