Skip to content

Issue with mkdocs documentation #43

@partha51613

Description

@partha51613

Description

I followed the documentation to set up MkDocs using the docker-compose.yml example provided on the site.
However, the container repeatedly crashes and restarts.

Cause

According to the current instructions, the project root is mounted directly to /docs inside the container.
Upon testing, I found that MkDocs expects the following directory structure:

mkdocs/
├── docker-compose.yml
└── mkdocs-data
├── docs
│   └── index.md
└── mkdocs.yml

The mounted directory must contain both the mkdocs.yml configuration file and the docs/ folder.
Mounting only the root directory (as currently suggested) prevents MkDocs from finding its configuration file, causing the container to fail.

Proposed Fix

In the docker-compose.yml, update the volume mapping to point to the mkdocs-data directory instead of the project root:

version: '3'
services:
  mkdocs:
    image: squidfunk/mkdocs-material
    ports:
      - "9090:8000"
    volumes:
      - ./mkdocs-data:/docs
    restart: unless-stopped

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions