A Flask web application that provides a real-time markdown editor with MkDocs Material theme preview. Perfect for creating and editing documentation with instant visual feedback using the beautiful Material Design theme.
Just want to try it out? No volumes needed:
docker run -d \
--name mkdocs-material-preview \
-p 8291:5000 \
-p 8000:8000 \
samapriya/mkdocs-preview:latest
For ongoing work with your own documentation:
docker run -d \
--name mkdocs-material-preview \
-p 8291:5000 \
-p 8000:8000 \
-v $(pwd)/docs:/app/docs \
-v $(pwd)/mkdocs.yml:/app/mkdocs.yml \
samapriya/mkdocs-preview:latest
For complete control with custom themes and configurations:
docker run -d \
--name mkdocs-material-preview \
-p 8291:5000 \
-p 8000:8000 \
-v $(pwd)/docs:/app/docs \
-v $(pwd)/mkdocs.yml:/app/mkdocs.yml \
-v $(pwd)/overrides:/app/overrides \
-v $(pwd)/includes:/app/includes \
-v $(pwd)/templates:/app/templates \
samapriya/mkdocs-preview:latest
Access the application at:
version: '3.8'
services:
mkdocs-material-preview:
image: samapriya/mkdocs-preview:latest
ports:
- "8291:5000"
- "8000:8000"
restart: unless-stopped
version: '3.8'
services:
mkdocs-material-preview:
image: samapriya/mkdocs-preview:latest
ports:
- "8291:5000"
- "8000:8000"
volumes:
- ./docs:/app/docs
- ./mkdocs.yml:/app/mkdocs.yml
- ./overrides:/app/overrides # Optional: custom theme overrides
- ./includes:/app/includes # Optional: snippet includes
- ./templates:/app/templates # Optional: custom templates
restart: unless-stopped
For simple testing and evaluation:
version: '3.8'
services:
mkdocs-material-preview:
image: samapriya/mkdocs-preview:latest
container_name: mkdocs-material-preview
ports:
- "8291:5000"
- "8000:8000"
environment:
- FLASK_ENV=production
- PYTHONUNBUFFERED=1
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- mkdocs-material-network
networks:
mkdocs-material-network:
driver: bridge
For production use with persistent data:
version: '3.8'
services:
mkdocs-material-preview:
image: samapriya/mkdocs-preview:latest
container_name: mkdocs-material-preview
ports:
- "8291:5000"
- "8000:8000"
volumes:
- mkdocs_docs:/app/docs
- mkdocs_includes:/app/includes
- mkdocs_overrides:/app/overrides
- mkdocs_templates:/app/templates
- mkdocs_config:/app/mkdocs.yml
environment:
- FLASK_ENV=production
- PYTHONUNBUFFERED=1
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- mkdocs-material-network
networks:
mkdocs-material-network:
driver: bridge
volumes:
mkdocs_docs:
driver: local
mkdocs_includes:
driver: local
mkdocs_overrides:
driver: local
mkdocs_templates:
driver: local
mkdocs_config:
driver: local
The container includes default directories and configurations, so volumes are optional. Use them only when you need:
| Host Path | Container Path | Purpose | Required |
|---|---|---|---|
./docs | /app/docs | Your markdown documentation files | Optional - container has example content |
./mkdocs.yml | /app/mkdocs.yml | MkDocs configuration file | Optional - container creates default config |
./includes | /app/includes | Include files for snippets | Optional - for advanced usage |
./overrides | /app/overrides | Theme overrides and customizations | Optional - for theme customization |
./templates | /app/templates | Custom templates | Optional - for custom layouts |
💡 Pro Tip: Start without any volumes to test the application, then add volumes as needed for persistence and customization.
| Port | Service | Description |
|---|---|---|
5000 | Flask App | Main editor interface |
8000 | MkDocs | Live preview server |
| Variable | Default | Description |
|---|---|---|
FLASK_ENV | production | Flask environment mode |
PYTHONUNBUFFERED | 1 | Python output buffering |
MKDOCS_PORT | 8000 | MkDocs preview server port |
FLASK_PORT | 5000 | Flask application port |
The application uses your existing mkdocs.yml configuration file. If none exists, a default configuration will be created with:
docker run -p 8291:5000 -p 8000:8000 samapriya/mkdocs-preview:latest
docs/ folderoverrides/ folder if desiredThe container includes a built-in health check that monitors the Flask application:
docker ps # Check container health status
site_name: My Documentation
theme:
name: material
palette:
- scheme: default
primary: blue
toggle:
icon: material/brightness-7
name: Switch to dark mode
- scheme: slate
primary: blue
toggle:
icon: material/brightness-4
name: Switch to light mode
plugins:
- search
- mermaid2
markdown_extensions:
- admonition
- pymdownx.highlight
- pymdownx.superfences
- pymdownx.tabbed
- pymdownx.details
mkdocs mkdocs-material material-design documentation markdown flask live-preview editor mermaid python technical-writing
Perfect for: Technical writers, developers, documentation teams, and anyone who wants to create beautiful documentation with real-time preview capabilities.
Content type
Image
Digest
sha256:d1455e7fe…
Size
122.3 MB
Last updated
about 1 year ago
docker pull samapriya/mkdocs-preview