Files
Memoh/assets/installation_docker.md.Ce3JA8xc.js
T
2026-02-26 12:21:05 +00:00

11 lines
15 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{_ as i,o as a,c as e,ag as t}from"./chunks/framework.ePeAWSvT.js";const c=JSON.parse('{"title":"Docker Installation","description":"","frontmatter":{},"headers":[],"relativePath":"installation/docker.md","filePath":"installation/docker.md","lastUpdated":1772108429000}'),n={name:"installation/docker.md"};function l(o,s,h,r,p,d){return a(),e("div",null,[...s[0]||(s[0]=[t(`<h1 id="docker-installation" tabindex="-1">Docker Installation <a class="header-anchor" href="#docker-installation" aria-label="Permalink to &quot;Docker Installation&quot;"></a></h1><p>Docker is the recommended way to run Memoh. The stack includes PostgreSQL, Qdrant, the main server (with embedded Containerd), agent gateway, and web UI — all orchestrated via Docker Compose. You do not need to install containerd, nerdctl, or buildkit on your host; everything runs inside containers.</p><h2 id="prerequisites" tabindex="-1">Prerequisites <a class="header-anchor" href="#prerequisites" aria-label="Permalink to &quot;Prerequisites&quot;"></a></h2><ul><li><a href="https://docs.docker.com/get-docker/" target="_blank" rel="noreferrer">Docker</a></li><li><a href="https://docs.docker.com/compose/install/" target="_blank" rel="noreferrer">Docker Compose v2</a></li><li>Git</li></ul><h2 id="one-click-install-recommended" tabindex="-1">One-Click Install (Recommended) <a class="header-anchor" href="#one-click-install-recommended" aria-label="Permalink to &quot;One-Click Install (Recommended)&quot;"></a></h2><p>Run the official install script (requires Docker and Docker Compose):</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -fsSL</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://memoh.sh</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> sh</span></span></code></pre></div><p>The script will:</p><ol><li>Check for Docker and Docker Compose</li><li>Prompt for configuration (workspace, data directory, admin credentials, JWT secret, Postgres password, China mirror)</li><li>Clone the repository</li><li>Generate <code>config.toml</code> from the Docker template with your settings</li><li>Pull images and start all services</li></ol><p><strong>Silent install</strong> (use all defaults, no prompts):</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -fsSL</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://memoh.sh</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -s</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span></span></code></pre></div><p>Defaults when running silently:</p><ul><li>Workspace: <code>~/memoh</code></li><li>Data directory: <code>~/memoh/data</code></li><li>Admin: <code>admin</code> / <code>admin123</code></li><li>JWT secret: auto-generated</li><li>Postgres password: <code>memoh123</code></li></ul><h2 id="manual-install" tabindex="-1">Manual Install <a class="header-anchor" href="#manual-install" aria-label="Permalink to &quot;Manual Install&quot;"></a></h2><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clone</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://github.com/memohai/Memoh.git</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Memoh</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">cp</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> conf/app.docker.toml</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> config.toml</span></span></code></pre></div><p>Edit <code>config.toml</code> — at minimum change:</p><ul><li><code>admin.password</code> — Admin password</li><li><code>auth.jwt_secret</code> — Generate with <code>openssl rand -base64 32</code></li><li><code>postgres.password</code> — Database password (also set <code>POSTGRES_PASSWORD</code> env var to match)</li></ul><p>Then start:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> POSTGRES_PASSWORD=your-db-password</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> compose</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> up</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -d</span></span></code></pre></div><blockquote><p>On macOS or if your user is in the <code>docker</code> group, <code>sudo</code> is not required.</p></blockquote><blockquote><p><strong>Important</strong>: <code>docker-compose.yml</code> mounts <code>./config.toml</code> by default. You must create this file before starting — running without it will fail.</p></blockquote><h3 id="china-mainland-mirror" tabindex="-1">China Mainland Mirror <a class="header-anchor" href="#china-mainland-mirror" aria-label="Permalink to &quot;China Mainland Mirror&quot;"></a></h3><p>For users in mainland China who cannot access Docker Hub directly, uncomment the <code>registry</code> line in <code>config.toml</code>:</p><div class="language-toml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">toml</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">mcp</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">registry = </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;memoh.cn&quot;</span></span></code></pre></div><p>And use the China mirror compose overlay:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> compose</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> docker-compose.yml</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> docker/docker-compose.cn.yml</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> up</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -d</span></span></code></pre></div><p>The install script handles this automatically when you answer &quot;yes&quot; to the China mirror prompt.</p><h2 id="access-points" tabindex="-1">Access Points <a class="header-anchor" href="#access-points" aria-label="Permalink to &quot;Access Points&quot;"></a></h2><p>After startup:</p><table tabindex="0"><thead><tr><th>Service</th><th>URL</th></tr></thead><tbody><tr><td>Web UI</td><td><a href="http://localhost:8082" target="_blank" rel="noreferrer">http://localhost:8082</a></td></tr><tr><td>API</td><td><a href="http://localhost:8080" target="_blank" rel="noreferrer">http://localhost:8080</a></td></tr><tr><td>Agent Gateway</td><td><a href="http://localhost:8081" target="_blank" rel="noreferrer">http://localhost:8081</a></td></tr></tbody></table><p>Default login: <code>admin</code> / <code>admin123</code> (change this in <code>config.toml</code>).</p><p>First startup may take 12 minutes while images are pulled and services initialize.</p><h2 id="common-commands" tabindex="-1">Common Commands <a class="header-anchor" href="#common-commands" aria-label="Permalink to &quot;Common Commands&quot;"></a></h2><blockquote><p>Prefix with <code>sudo</code> on Linux if your user is not in the <code>docker</code> group.</p></blockquote><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> compose</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> up</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -d</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Start</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> compose</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> down</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Stop</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> compose</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> logs</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -f</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # View logs</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> compose</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ps</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Status</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> compose</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pull</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> compose</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> up</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -d</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Update to latest images</span></span></code></pre></div><h2 id="production-checklist" tabindex="-1">Production Checklist <a class="header-anchor" href="#production-checklist" aria-label="Permalink to &quot;Production Checklist&quot;"></a></h2><ol><li><strong>Passwords</strong> — Change all default passwords and secrets in <code>config.toml</code></li><li><strong>HTTPS</strong> — Configure SSL (e.g. via <code>docker-compose.override.yml</code> with certs or a reverse proxy)</li><li><strong>Firewall</strong> — Restrict access to necessary ports</li><li><strong>Resource limits</strong> — Set memory/CPU limits for containers</li><li><strong>Backups</strong> — Regular backups of Postgres and Qdrant data</li></ol><h2 id="troubleshooting" tabindex="-1">Troubleshooting <a class="header-anchor" href="#troubleshooting" aria-label="Permalink to &quot;Troubleshooting&quot;"></a></h2><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> compose</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> logs</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> server</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # View main service logs</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> compose</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> config</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Validate configuration</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> compose</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --no-cache</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> compose</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> up</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -d</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Full rebuild</span></span></code></pre></div><h2 id="security-warnings" tabindex="-1">Security Warnings <a class="header-anchor" href="#security-warnings" aria-label="Permalink to &quot;Security Warnings&quot;"></a></h2><ul><li>The main service runs with privileged container access — only run in trusted environments</li><li>You must change all default passwords and secrets before production use</li><li>Use HTTPS in production</li></ul>`,41)])])}const g=i(n,[["render",l]]);export{c as __pageData,g as default};