Skip to content

Commit 3b5ebf1

Browse files
Fix Windows User Only: Automatic docker-compose.yml Fix in docker-start.bat
Added code to automatically fix the docker-compose.yml file for Windows users The script now copies the content from docker/compose/docker-compose.yml to ensure proper formatting This happens transparently every time docker-start.bat is run The fix addresses line ending issues and encoding problems that can cause the "Top-level object must be a mapping" error Removed README Dependency in pyproject.toml Removed the readme = "README_MCP.md" line from fast-markdown-mcp/pyproject.toml This prevents the Python build system from looking for this file during installation Fixes the error: "OSError: Readme file does not exist: README_MCP.md" The MCP server will now build correctly in the Docker container Added Documentation in README.md Added a note in the Windows section of README.md explaining the automatic fix Provides context for users who might encounter similar issues These changes make the DevDocs project more robust on Windows systems by: Automatically handling platform-specific file format issues Removing unnecessary dependencies that were causing build failures Providing clear documentation about the fixes
1 parent d9a1e7f commit 3b5ebf1

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ DevDocs is designed to be easy to use with Docker, requiring minimal setup for n
9595

9696
### Prerequisites
9797

98-
- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your system
98+
- [Docker](https://docs.docker.com/get-docker/) installed on your system
9999
- Git for cloning the repository
100100

101101
### Quick Start with Docker (Recommended)
@@ -123,8 +123,10 @@ cd DevDocs
123123
# Start all services using Docker
124124
docker-start.bat
125125
```
126+
<details>
127+
<summary>Note for Windows Users</summary>
126128

127-
> **Note for Windows Users**: If you encounter permission issues, you may need to run the script as administrator or manually set permissions on the logs, storage, and crawl_results directories. The script uses the `icacls` command to set permissions, which might require elevated privileges on some Windows systems.
129+
> If you encounter permission issues, you may need to run the script as administrator or manually set permissions on the logs, storage, and crawl_results directories. The script uses the `icacls` command to set permissions, which might require elevated privileges on some Windows systems.
128130
>
129131
> **Manually Setting Permissions on Windows**:
130132
>
@@ -148,6 +150,15 @@ docker-start.bat
148150
> icacls storage /grant Everyone:F /T
149151
> icacls crawl_results /grant Everyone:F /T
150152
> ```
153+
</details>
154+
155+
<details>
156+
<summary>Note about docker-compose.yml on Windows</summary>
157+
158+
> If you encounter issues with the docker-compose.yml file (such as "Top-level object must be a mapping" error), the `docker-start.bat` script automatically fixes this by ensuring the file has the correct format and encoding. This fix is applied every time you run the script, so you don't need to manually modify the file.
159+
</details>
160+
161+
151162
152163
This single command will:
153164
1. Create all necessary directories
@@ -290,4 +301,4 @@ Final Output Construction: The final answer should be organized, directly addres
290301

291302
<p align="center">
292303
<sub>Make Software Development Better Again <a href="https://github.com/cyberagi/devdocs">Contribute to DevDocs</a></sub>
293-
</p>
304+
</p>

fast-markdown-mcp/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ description = "Fast MCP server for markdown content management with automatic fi
99
authors = [
1010
{ name = "CyberAGI Team" }
1111
]
12-
readme = "README_MCP.md"
1312
requires-python = ">=3.10"
1413
dependencies = [
1514
"mcp>=1.2.0",

scripts/docker/docker-start.bat

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ set "NC=[0m"
1111
set "ROOT_DIR=%CD%"
1212
echo %BLUE%Project root directory: %ROOT_DIR%%NC%
1313

14+
:: Fix docker-compose.yml file for Windows
15+
echo %BLUE%Ensuring docker-compose.yml is properly formatted...%NC%
16+
if exist "docker/compose/docker-compose.yml" (
17+
:: Create a temporary file with the correct content and encoding
18+
type nul > docker-compose.yml.tmp
19+
:: Copy content line by line to ensure proper line endings
20+
for /f "usebackq delims=" %%a in ("docker/compose/docker-compose.yml") do (
21+
echo %%a>> docker-compose.yml.tmp
22+
)
23+
:: Replace the original file
24+
move /y docker-compose.yml.tmp docker-compose.yml
25+
echo %GREEN%docker-compose.yml has been fixed for Windows compatibility%NC%
26+
) else (
27+
echo %RED%Warning: Could not find docker/compose/docker-compose.yml%NC%
28+
)
29+
1430
:: Create necessary directories with proper permissions
1531
echo %BLUE%Creating necessary directories...%NC%
1632
if not exist logs mkdir logs
@@ -68,6 +84,4 @@ goto loop
6884
:shutdown
6985
echo %BLUE%Shutting down services...%NC%
7086
docker-compose down
71-
echo %GREEN%All services stopped%NC%
72-
73-
endlocal
87+
echo %GREEN%All services stopped%NC%

0 commit comments

Comments
 (0)