docker-compose.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. services:
  2. db:
  3. image: postgres:15-alpine
  4. environment:
  5. POSTGRES_DB: wiki
  6. POSTGRES_PASSWORD: wikijsrocks
  7. POSTGRES_USER: wikijs
  8. logging:
  9. driver: "none"
  10. restart: unless-stopped
  11. volumes:
  12. - db-data:/var/lib/postgresql/data
  13. networks:
  14. - wikijs
  15. wiki:
  16. image: ghcr.io/requarks/wiki:2
  17. depends_on:
  18. - db
  19. environment:
  20. DB_TYPE: postgres
  21. DB_HOST: db
  22. DB_PORT: 5432
  23. DB_USER: wikijs
  24. DB_PASS: wikijsrocks
  25. DB_NAME: wiki
  26. logging:
  27. driver: "json-file"
  28. options:
  29. max-size: "10m"
  30. max-file: "3"
  31. restart: unless-stopped
  32. ports:
  33. - "3000:3000"
  34. networks:
  35. - wikijs
  36. # MCP server bridging agents and the wiki instance.
  37. # Runs the Streamable HTTP transport (built from the current source tree).
  38. #
  39. # 0.0.0.0 is a non-loopback bind, so the image validation (src/config)
  40. # requires WIKIJS_MCP_BEARER_TOKEN — set it to a long random value.
  41. # To keep the listener on the host-only interface, use 127.0.0.1 instead
  42. # and drop the published port.
  43. mcp:
  44. build: .
  45. depends_on:
  46. - wiki
  47. environment:
  48. WIKIJS_MCP_TRANSPORT: http
  49. WIKIJS_MCP_HOST: 0.0.0.0
  50. WIKIJS_MCP_PORT: "3001"
  51. WIKIJS_MCP_BEARER_TOKEN: ${WIKIJS_MCP_BEARER_TOKEN:?set a bearer token for the non-loopback MCP bind}
  52. WIKIJS_URL: http://wiki:3000
  53. WIKIJS_API_KEY: ${WIKIJS_API_KEY:?create an API key in the wiki first (Admin > API Access)}
  54. WIKIJS_ENABLE_EDIT: ${WIKIJS_ENABLE_EDIT:-false}
  55. restart: unless-stopped
  56. ports:
  57. - "3001:3001"
  58. healthcheck:
  59. test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3001/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
  60. interval: 30s
  61. timeout: 5s
  62. retries: 3
  63. networks:
  64. - wikijs
  65. volumes:
  66. db-data:
  67. networks:
  68. wikijs:
  69. driver: bridge