docker config added
This commit is contained in:
34
Dockerfile
Normal file
34
Dockerfile
Normal 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
21
docker-compose.yml
Normal 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
|
||||
@ -232,6 +232,8 @@ nav:
|
||||
- Release Notes:
|
||||
- Overview: releasenotes/releasenotes.html.md
|
||||
- Release Notes: releasenotes/releasenotes.html.md
|
||||
|
||||
|
||||
# Markdown extensions
|
||||
markdown_extensions:
|
||||
- admonition
|
||||
|
||||
Reference in New Issue
Block a user