CouchDB.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <NuxtLayout name="guides">
  3. <template #intro>
  4. <div class="max-w-xl">
  5. <h2 class="text-4xl font-extrabold text-gray-100 sm:text-5xl sm:tracking-tight lg:text-6xl">
  6. CouchDB
  7. </h2>
  8. <small class="pl-3 text-xs font-medium text-gray-200 uppercase tracking-widest italic">
  9. Infrastructure
  10. </small>
  11. <p class="mt-5 text-xl text-indigo-300">
  12. Apache CouchDB is an open-source document-oriented NoSQL database, implemented in Erlang.
  13. </p>
  14. </div>
  15. </template>
  16. <template #links>
  17. <div class="mt-10 w-full max-w-xs lg:mt-0">
  18. <label for="currency" class="block text-2xl font-medium text-indigo-400">
  19. Recommended Links
  20. </label>
  21. <div class="flex flex-col mt-1.5 pl-3 relative text-indigo-200">
  22. <div>
  23. ↳ <a href="https://docs.docker.com/engine/install/" target="_blank" class="hover:underline">
  24. CouchDB Engine Installation
  25. </a>
  26. </div>
  27. <div>
  28. ↳ <NuxtLink>
  29. Nuxt Link #2
  30. </NuxtLink>
  31. </div>
  32. <div>
  33. ↳ <NuxtLink>
  34. Nuxt Link #3
  35. </NuxtLink>
  36. </div>
  37. </div>
  38. </div>
  39. </template>
  40. <!-- Page Section -->
  41. <template #main>
  42. <h1 class="mt-5 text-3xl font-bold">
  43. Setup CouchDB
  44. </h1>
  45. <small class="block pl-3 text-sm font-medium text-rose-500 tracking-widest uppercase">
  46. Level: <span class="text-lg">Easy</span>
  47. </small>
  48. <section class="mt-3 py-5 max-w-5xl mx-auto">
  49. <div class="p-5 text-2xl font-medium bg-gray-100 border-4 border-gray-300 rounded-xl">
  50. Deploys a NoSQL database using Docker
  51. <small class="block text-sm">
  52. NOTE: All database data is stored in the current working folder.
  53. </small>
  54. </div>
  55. <pre class="mt-5 p-5 bg-yellow-100 border-4 border-yellow-300 rounded-xl">
  56. <code>docker run --rm \
  57. --name my-couchdb \
  58. -e COUCHDB_USER=admin \
  59. -e COUCHDB_PASSWORD=password \
  60. -e COUCHDB_ERLANG_COOKIE=33595219-bc56-43ca-9df6-a9b4145f1e49 \
  61. -p 127.0.0.1:5984:5984 \
  62. -v $(pwd):/opt/couchdb/data \
  63. couchdb:3.3.1
  64. </code></pre>
  65. <div class="mt-3 p-5 font-medium bg-fuchsia-200 border-4 border-fuchsia-300 rounded-xl">
  66. For PRODUCTION deployments, you can make the server run "permanently".
  67. <small class="block">
  68. --rm (remove this flag)
  69. </small>
  70. <small class="block">
  71. -d --restart unless-stopped (replace with these flags)
  72. </small>
  73. </div>
  74. </section>
  75. <section class="mt-3 py-5 max-w-5xl mx-auto">
  76. <div class="p-5 text-2xl font-medium bg-gray-100 border-4 border-gray-300 rounded-xl">
  77. Deploys a NoSQL database using Docker Compose
  78. <small class="block text-sm">
  79. NOTE: All database data is stored in the current working folder.
  80. </small>
  81. </div>
  82. <pre class="mt-5 p-5 bg-yellow-100 border-4 border-yellow-300 rounded-xl">
  83. <code>services:
  84. couchdb:
  85. image: couchdb
  86. container_name: couchdb
  87. restart: unless-stopped
  88. ports:
  89. - '127.0.0.1:5984:5984'
  90. - '127.0.0.1:4369:4369'
  91. - '127.0.0.1:9100:9100'
  92. environment:
  93. - COUCHDB_USER=${COUCHDB_USER} # change this to match your system's ENV
  94. - COUCHDB_PASSWORD=${COUCHDB_PASSWORD} # change this to match your system's ENV
  95. volumes:
  96. - ./data:/opt/couchdb/data
  97. logging: # apply better controls to Docker overlay folder
  98. driver: 'json-file'
  99. options:
  100. max-file: '5'
  101. max-size: '10m'
  102. networks:
  103. couchdb-network:
  104. driver: bridge
  105. </code></pre>
  106. </section>
  107. <section class="mt-3 py-5 max-w-5xl mx-auto">
  108. <div class="p-5 text-2xl font-medium bg-gray-100 border-4 border-gray-300 rounded-xl">
  109. Add a New User
  110. <small class="block text-sm">
  111. NOTE: TBD...
  112. </small>
  113. </div>
  114. <pre class="mt-5 p-5 bg-yellow-100 border-4 border-yellow-300 rounded-xl">
  115. <code>curl -X PUT http://localhost:5984/_users/org.couchdb.user:new_username \
  116. -H "Accept: application/json" \
  117. -H "Content-Type: application/json" \
  118. -d '{"name": "new_username", "password": "new_password", "roles": [], "type": "user"}'
  119. </code></pre>
  120. </section>
  121. </template>
  122. </NuxtLayout>
  123. </template>