Merge pull request #21 from kiriyms/fix/add-docker-flag-override

Fix/add docker flag override
This commit is contained in:
Barry Yip 2025-11-05 22:50:26 +08:00 committed by GitHub
commit 2616fc1a10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 3 deletions

View File

@ -20,4 +20,6 @@ RUN npm run build
EXPOSE 8080
# Default command to run the MCP server with HTTP transport
CMD ["node", "build/index.js", "--transport", "http", "--port", "8080"]
# Use ENTRYPOINT + CMD for flexibility
ENTRYPOINT ["node", "build/index.js"]
CMD ["--transport", "stdio", "--port", "8080"]

View File

@ -95,15 +95,30 @@ You can run mcp-discord using Docker. The Docker images are automatically built
**Docker Hub Repository**: [barryy625/mcp-discord](https://hub.docker.com/r/barryy625/mcp-discord)
Docker container uses `stdio` by default.
```bash
# Pull the latest image
docker pull barryy625/mcp-discord:latest
# Run with environment variable
docker run -e DISCORD_TOKEN=your_discord_bot_token -p 8080:8080 barryy625/mcp-discord:latest
docker run -e DISCORD_TOKEN=your_discord_bot_token barryy625/mcp-discord:latest
# Or run with command line config
docker run -p 8080:8080 barryy625/mcp-discord:latest --config "your_discord_bot_token"
docker run barryy625/mcp-discord:latest --config "your_discord_bot_token"
```
Alternatively, override the `--transport` and `--port` flags to run `http` on a port of your choosing. In this case, also map the ports.
```bash
# Pull the latest image
docker pull barryy625/mcp-discord:latest
# Run with environment variable
docker run -e DISCORD_TOKEN=your_discord_bot_token -p 8080:8080 barryy625/mcp-discord:latest --transport http --port 8081
# Or run with command line config
docker run -p 8080:8080 barryy625/mcp-discord:latest --config "your_discord_bot_token" --transport http --port 8081
```
**Available Tags:**