{"id":11053,"date":"2025-04-18T18:23:53","date_gmt":"2025-04-18T10:23:53","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/11053.html"},"modified":"2025-04-18T18:23:53","modified_gmt":"2025-04-18T10:23:53","slug":"%e5%9c%a8cpu%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e9%83%a8%e7%bd%b2ollama%e5%92%8cdify%e7%9a%84%e8%bf%87%e7%a8%8b%e8%ae%b0%e5%bd%95","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/11053.html","title":{"rendered":"\u5728CPU\u670d\u52a1\u5668\u4e0a\u90e8\u7f72Ollama\u548cDify\u7684\u8fc7\u7a0b\u8bb0\u5f55"},"content":{"rendered":"<p>\u5728\u672c\u6307\u5357\u4e2d&#xff0c;\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728CPU\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eOllama\u6a21\u578b\u670d\u52a1\u548cDify\u5e73\u53f0&#xff0c;\u4ee5\u53ca\u5982\u4f55\u5229\u7528Docker\u5b9e\u73b0\u8fd9\u4e9b\u670d\u52a1\u7684\u9ad8\u6548\u90e8\u7f72\u548c\u8fc1\u79fb\u3002\u672c\u6587\u5206\u4e3a\u4e09\u5927\u90e8\u5206&#xff1a;Ollama\u90e8\u7f72\u3001Dify\u73af\u5883\u914d\u7f6e\u548cDocker\u73af\u5883\u7ba1\u7406&#xff0c;\u9002\u5408\u9700\u8981\u5728\u672c\u5730\u6216\u79c1\u6709\u73af\u5883\u4e2d\u8fd0\u884cAI\u670d\u52a1\u7684\u5f00\u53d1\u8005\u548c\u8fd0\u7ef4\u4eba\u5458\u53c2\u8003\u3002 <\/p>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>\n<ul>\n<li>\u4e00\u3001Ollama\u90e8\u7f72<\/li>\n<li>\n<ul>\n<li>1.1 \u4e8c\u8fdb\u5236\u6587\u4ef6\u5b89\u88c5\u65b9\u6cd5<\/li>\n<li>1.2 Docker\u5b89\u88c5\u65b9\u6cd5&#xff08;\u63a8\u8350&#xff09;<\/li>\n<\/ul>\n<\/li>\n<li>\u4e8c\u3001Dify\u90e8\u7f72\u4e0e\u914d\u7f6e<\/li>\n<li>\n<ul>\n<li>2.1 Dify\u9879\u76ee\u6253\u5305\u4e0e\u8fc1\u79fb<\/li>\n<li>2.2 Dify\u4e0eOllama\u96c6\u6210<\/li>\n<li>2.3 Dify\u6570\u636e\u6301\u4e45\u5316<\/li>\n<\/ul>\n<\/li>\n<li>\u4e09\u3001Docker\u73af\u5883\u7ba1\u7406<\/li>\n<li>\n<ul>\n<li>3.1 Docker Compose\u5b89\u88c5<\/li>\n<li>3.2 Docker Compose\u547d\u4ee4\u66f4\u65b0<\/li>\n<li>3.3 \u5b8c\u6574\u7684\u9879\u76ee\u8fc1\u79fb\u6d41\u7a0b<\/li>\n<\/ul>\n<\/li>\n<li>\u603b\u7ed3<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr \/>\n<p>&#x1f389;\u8fdb\u5165\u4e91\u7aef\u8fd0\u7ef4\u4e13\u680f | &#x1f680;\u67e5\u770b\u66f4\u591a\u4e13\u680f\u5185\u5bb9<\/p>\n<hr \/>\n<h3>\u4e00\u3001Ollama\u90e8\u7f72<\/h3>\n<p>Ollama\u662f\u4e00\u4e2a\u4f18\u79c0\u7684\u5f00\u6e90\u5de5\u5177&#xff0c;\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5728\u672c\u5730\u6216\u670d\u52a1\u5668\u4e0a\u8f7b\u677e\u8fd0\u884c\u5404\u79cd\u5927\u8bed\u8a00\u6a21\u578b\u3002\u4ee5\u4e0b\u4ecb\u7ecd\u4e24\u79cd\u5b89\u88c5\u65b9\u6cd5\u53ca\u5176\u4f18\u7f3a\u70b9\u3002<\/p>\n<h4>1.1 \u4e8c\u8fdb\u5236\u6587\u4ef6\u5b89\u88c5\u65b9\u6cd5<\/h4>\n<p>\u6309\u7167ollama\u7684Linux\u5b89\u88c5\u6559\u7a0b&#xff0c;\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5b89\u88c5Ollama&#xff1a;<\/p>\n<p><span class=\"token function\">curl<\/span> -L https:\/\/ollama.com\/download\/ollama-linux-amd64.tgz -o ollama-linux-amd64.tgz<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">tar<\/span> -C \/usr -xzf ollama-linux-amd64.tgz<\/p>\n<p>\u547d\u4ee4\u89e3\u6790&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u6761\u547d\u4ee4\u4f7f\u7528curl\u4e0b\u8f7dOllama\u7684\u538b\u7f29\u5305&#xff1a;<\/p>\n<ul>\n<li>-L\u53c2\u6570\u5141\u8bb8curl\u8ddf\u968fHTTP\u91cd\u5b9a\u5411<\/li>\n<li>\u5c06\u4e0b\u8f7d\u7684\u6587\u4ef6\u4fdd\u5b58\u4e3aollama-linux-amd64.tgz<\/li>\n<\/ul>\n<p>\u7b2c\u4e8c\u6761\u547d\u4ee4\u89e3\u538b\u6587\u4ef6\u5230\u7cfb\u7edf\u76ee\u5f55&#xff1a;<\/p>\n<ul>\n<li>sudo\u4f7f\u7528\u7ba1\u7406\u5458\u6743\u9650<\/li>\n<li>tar\u662fLinux\u7684\u5f52\u6863\u5904\u7406\u5de5\u5177<\/li>\n<li>-C \/usr\u6307\u5b9a\u89e3\u538b\u76ee\u6807\u4e3a\/usr\u76ee\u5f55<\/li>\n<li>-x\u8868\u793a\u89e3\u538b\u6a21\u5f0f<\/li>\n<li>-z\u8868\u793a\u5904\u7406gzip\u538b\u7f29\u683c\u5f0f<\/li>\n<li>-f\u6307\u5b9a\u6587\u4ef6\u540d<\/li>\n<\/ul>\n<p>\u89e3\u538b\u5b8c\u6210\u540e&#xff0c;\u7406\u8bba\u4e0a\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884collama serve\u542f\u52a8\u670d\u52a1&#xff0c;\u4f46\u5728\u5b9e\u9645\u64cd\u4f5c\u4e2d\u53ef\u80fd\u4f1a\u9047\u5230\u9519\u8bef&#xff1a;<\/p>\n<p>ollama serve<\/p>\n<p>\u5982\u4e0b\u56fe\u6240\u793a&#xff0c;\u6267\u884c\u547d\u4ee4\u540e\u51fa\u73b0\u9519\u8bef\u63d0\u793a&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102352-680228384f1c7.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u6b64\u7c7b\u9519\u8bef\u53ef\u80fd\u662f\u7531\u7cfb\u7edf\u4f9d\u8d56\u9879\u7f3a\u5931\u6216\u6743\u9650\u95ee\u9898\u5bfc\u81f4\u7684&#xff0c;\u89e3\u51b3\u8d77\u6765\u53ef\u80fd\u6bd4\u8f83\u590d\u6742\u3002<\/p>\n<h4>1.2 Docker\u5b89\u88c5\u65b9\u6cd5&#xff08;\u63a8\u8350&#xff09;<\/h4>\n<p>\u8003\u8651\u5230\u4e8c\u8fdb\u5236\u5b89\u88c5\u7684\u590d\u6742\u6027&#xff0c;\u6211\u4eec\u53ef\u4ee5\u8f6c\u5411\u4f7f\u7528Docker\u5b89\u88c5Ollama&#xff0c;\u8fd9\u79cd\u65b9\u5f0f\u66f4\u52a0\u53ef\u9760\u548c\u4e00\u81f4\u3002\u53c2\u8003ollama\u7684docker\u5b89\u88c5\u6559\u7a0b&#xff0c;\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4&#xff1a;<\/p>\n<p>docker run -d -v \/root\/models:\/root\/.ollama -p <span class=\"token number\">11434<\/span>:11434 &#8211;name ollama ollama\/ollama:0.5.3<\/p>\n<p>\u8fdb\u5165ollama\u7684\u547d\u4ee4\u662f<\/p>\n<p>docker <span class=\"token builtin class-name\">exec<\/span> -it ollama \/bin\/bash<\/p>\n<p>\u547d\u4ee4\u8be6\u89e3&#xff1a;<\/p>\n<ul>\n<li>docker run&#xff1a;\u521b\u5efa\u5e76\u542f\u52a8\u5bb9\u5668<\/li>\n<li>-d&#xff1a;\u540e\u53f0\u8fd0\u884c\u5bb9\u5668<\/li>\n<li>-v \/root\/models:\/root\/.ollama&#xff1a;\u6570\u636e\u5377\u6302\u8f7d&#xff0c;\u5c06\u4e3b\u673a\u76ee\u5f55\u6620\u5c04\u5230\u5bb9\u5668\u5185\u90e8&#xff0c;\u7528\u4e8e\u6301\u4e45\u5316\u5b58\u50a8\u6a21\u578b\u6587\u4ef6<\/li>\n<li>-p 11434:11434&#xff1a;\u7aef\u53e3\u6620\u5c04&#xff0c;\u4f7fOllama\u670d\u52a1\u53ef\u901a\u8fc7\u4e3b\u673a11434\u7aef\u53e3\u8bbf\u95ee<\/li>\n<li>&#8211;name ollama&#xff1a;\u5bb9\u5668\u547d\u540d\u4e3a&#034;ollama&#034;<\/li>\n<li>ollama\/ollama:0.5.3&#xff1a;\u6307\u5b9a\u4f7f\u7528\u7684\u955c\u50cf\u53ca\u7248\u672c<\/li>\n<\/ul>\n<p>\u4e5f\u53ef\u4ee5\u4f7f\u7528\u4e0d\u540c\u7684\u6302\u8f7d\u8def\u5f84&#xff1a;<\/p>\n<p>docker run -v \/usr\/share\/ollama\/.ollama:\/root\/.ollama -p <span class=\"token number\">11434<\/span>:11434 &#8211;name ollama ollama\/ollama:0.5.3<\/p>\n<p>\u4f7f\u7528Docker\u90e8\u7f72\u7684\u4f18\u52bf&#xff1a;<\/p>\n<ul>\n<li>\u51cf\u5c11\u4e86\u4f9d\u8d56\u9879\u51b2\u7a81<\/li>\n<li>\u73af\u5883\u9694\u79bb&#xff0c;\u4e0d\u5f71\u54cd\u4e3b\u673a\u7cfb\u7edf<\/li>\n<li>\u4fbf\u4e8e\u7248\u672c\u7ba1\u7406\u548c\u8fc1\u79fb<\/li>\n<li>\u4e00\u81f4\u7684\u8fd0\u884c\u73af\u5883&#xff0c;\u51cf\u5c11&#034;\u5728\u6211\u673a\u5668\u4e0a\u80fd\u8fd0\u884c&#034;\u7684\u95ee\u9898<\/li>\n<\/ul>\n<h3>\u4e8c\u3001Dify\u90e8\u7f72\u4e0e\u914d\u7f6e<\/h3>\n<p>Dify\u662f\u4e00\u4e2a\u5f3a\u5927\u7684LLM\u5e94\u7528\u5f00\u53d1\u5e73\u53f0&#xff0c;\u652f\u6301\u5feb\u901f\u6784\u5efa\u57fa\u4e8e\u5927\u8bed\u8a00\u6a21\u578b\u7684\u5e94\u7528\u3002\u8003\u8651\u5230Dify\u7684Docker\u5f88\u591a&#xff0c;\u4e0b\u8f7d\u5f88\u6162\u3002\u6211\u4eec\u53ef\u4ee5\u57fa\u4e8e\u522b\u7684\u670d\u52a1\u5668\u4e0a\u53ef\u4ee5\u7528\u7684Dify&#xff0c;\u6253\u5305\u5176Docker\u73af\u5883&#xff0c;\u5b9e\u73b0Dify\u7684\u79bb\u7ebf\u9ad8\u6548\u90e8\u7f72\u3002<\/p>\n<h4>2.1 Dify\u9879\u76ee\u6253\u5305\u4e0e\u8fc1\u79fb<\/h4>\n<p>\u4e3a\u4e86\u5b9e\u73b0Dify\u9879\u76ee\u7684\u79bb\u7ebf\u90e8\u7f72&#xff0c;\u6211\u4eec\u9700\u8981\u5148\u6253\u5305\u73b0\u6709\u9879\u76ee\u7684\u6240\u6709Docker\u955c\u50cf&#xff0c;\u8fdb\u5165Dify\u7684docker\u76ee\u5f55\u4e0b&#xff0c;\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4&#xff1a;<\/p>\n<p>docker-compose images <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;FNR &gt; 1 {print <span class=\"token variable\">$2<\/span>&#034;:&#034;<span class=\"token variable\">$3<\/span>}&#039;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">sort<\/span> -u <span class=\"token operator\">|<\/span> <span class=\"token function\">xargs<\/span> docker save -o all_images.tar<\/p>\n<p>\u8fd9\u6761\u547d\u4ee4\u7684\u4f5c\u7528\u662f\u5c06\u5f53\u524dDify\u9879\u76ee\u4e2d\u4f7f\u7528\u7684\u6240\u6709Docker\u955c\u50cf\u6253\u5305\u6210\u4e00\u4e2a\u5355\u4e00\u7684tar\u6587\u4ef6&#xff0c;\u4ee5\u4fbf\u4e8e\u79bb\u7ebf\u73af\u5883\u4e0b\u7684\u5b89\u88c5\u4e0e\u8fc1\u79fb\u3002\u547d\u4ee4\u7ec6\u8282\u89e3\u6790&#xff1a;<\/p>\n<li>docker-compose images&#xff1a;\u5217\u51fa\u5f53\u524dCompose\u9879\u76ee\u4e2d\u4f7f\u7528\u7684\u6240\u6709\u955c\u50cf<\/li>\n<li>awk &#039;FNR &gt; 1 {print $2&#034;:&#034;$3}&#039;&#xff1a;\u63d0\u53d6\u6bcf\u4e2a\u955c\u50cf\u7684\u540d\u79f0\u548c\u6807\u7b7e<\/li>\n<li>sort -u&#xff1a;\u6392\u5e8f\u5e76\u53bb\u9664\u91cd\u590d\u9879<\/li>\n<li>xargs docker save -o all_images.tar&#xff1a;\u5c06\u6240\u6709\u955c\u50cf\u4fdd\u5b58\u5230\u4e00\u4e2atar\u6587\u4ef6\u4e2d<\/li>\n<h4>2.2 Dify\u4e0eOllama\u96c6\u6210<\/h4>\n<p>Dify\u5e73\u53f0\u9700\u8981\u4e0eOllama\u670d\u52a1\u8fdb\u884c\u96c6\u6210\u624d\u80fd\u6b63\u5e38\u5de5\u4f5c\u3002\u4e00\u822c\u6765\u8bf4&#xff0c;\u6211\u4eec\u9700\u8981\u5728Dify\u7684\u914d\u7f6e\u4e2d\u6307\u5b9aOllama\u670d\u52a1\u7684\u5730\u5740&#xff1a;<\/p>\n<ul>\n<li>\u540c\u4e00\u4e3b\u673a\u4e0a&#xff1a;\u53ef\u4ee5\u4f7f\u7528http:\/\/localhost:11434\u6216Docker\u7f51\u7edc\u540d\u79f0http:\/\/ollama:11434<\/li>\n<li>\u4e0d\u540c\u4e3b\u673a\u4e0a&#xff1a;\u4f7f\u7528\u76ee\u6807\u670d\u52a1\u5668IP&#xff0c;\u5982http:\/\/192.168.1.100:11434<\/li>\n<\/ul>\n<h4>2.3 Dify\u6570\u636e\u6301\u4e45\u5316<\/h4>\n<p>\u4e0eOllama\u7c7b\u4f3c&#xff0c;Dify\u4e5f\u9700\u8981\u914d\u7f6e\u6570\u636e\u6301\u4e45\u5316&#xff0c;\u4ee5\u786e\u4fdd\u7528\u6237\u521b\u5efa\u7684\u5e94\u7528\u3001\u63d0\u793a\u8bcd\u5e93\u548c\u914d\u7f6e\u4fe1\u606f\u4e0d\u4f1a\u56e0\u5bb9\u5668\u91cd\u542f\u800c\u4e22\u5931\u3002\u8fd9\u901a\u5e38\u901a\u8fc7Docker\u5377\u6302\u8f7d\u5b9e\u73b0&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p>-v \/path\/to\/dify\/data:\/app\/data<br \/>\n-v \/path\/to\/dify\/uploads:\/app\/uploads<\/p>\n<h3>\u4e09\u3001Docker\u73af\u5883\u7ba1\u7406<\/h3>\n<p>Docker\u662f\u5b9e\u73b0Ollama\u548cDify\u9ad8\u6548\u90e8\u7f72\u7684\u5173\u952e\u5de5\u5177&#xff0c;\u638c\u63e1Docker\u7684\u57fa\u672c\u64cd\u4f5c\u548c\u73af\u5883\u7ba1\u7406\u5bf9\u4e8e\u6210\u529f\u90e8\u7f72\u81f3\u5173\u91cd\u8981\u3002<\/p>\n<h4>3.1 Docker Compose\u5b89\u88c5<\/h4>\n<p>\u5982\u679c\u60a8\u7684\u7cfb\u7edf\u4e2d\u5c1a\u672a\u5b89\u88c5Docker Compose&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5&#xff1a;<\/p>\n<p><span class=\"token function\">curl<\/span> -L https:\/\/github.com\/docker\/compose\/releases\/download\/v2.21.0\/docker-compose-<span class=\"token variable\"><span class=\"token variable\">&#096;<\/span><span class=\"token function\">uname<\/span> -s<span class=\"token variable\">&#096;<\/span><\/span>&#8211;<span class=\"token variable\"><span class=\"token variable\">&#096;<\/span><span class=\"token function\">uname<\/span> -m<span class=\"token variable\">&#096;<\/span><\/span> -o docker-compose-linux-x86_64<br \/>\n<span class=\"token function\">cp<\/span> docker-compose-linux-x86_64 \/usr\/local\/bin\/docker-compose<br \/>\n<span class=\"token function\">chmod<\/span> &#043;x \/usr\/local\/bin\/docker-compose<\/p>\n<p>\u8fd9\u7ec4\u547d\u4ee4\u7684\u4f5c\u7528\u662f&#xff1a;<\/p>\n<li>\u4e0b\u8f7d\u4e0e\u5f53\u524d\u7cfb\u7edf\u67b6\u6784\u5339\u914d\u7684Docker Compose\u4e8c\u8fdb\u5236\u6587\u4ef6<\/li>\n<li>\u5c06\u6587\u4ef6\u590d\u5236\u5230\u7cfb\u7edfPATH\u8def\u5f84\u4e2d<\/li>\n<li>\u6dfb\u52a0\u6267\u884c\u6743\u9650<\/li>\n<p>\u6267\u884c\u5b8c\u6210\u540e&#xff0c;\u53ef\u4ee5\u9a8c\u8bc1\u5b89\u88c5\u7ed3\u679c&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102352-6802283862ff8.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>3.2 Docker Compose\u547d\u4ee4\u66f4\u65b0<\/h4>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f&#xff0c;Docker\u7684\u65b0\u7248\u672c\u5df2\u5c06Docker Compose\u96c6\u6210\u5230Docker CLI\u4e2d&#xff0c;\u547d\u4ee4\u683c\u5f0f\u6709\u6240\u53d8\u5316&#xff1a;<\/p>\n<ul>\n<li>\u65e7\u7248\u547d\u4ee4&#xff1a;docker-compose&#xff08;\u5e26\u8fde\u5b57\u7b26&#xff09;<\/li>\n<li>\u65b0\u7248\u547d\u4ee4&#xff1a;docker compose&#xff08;\u65e0\u8fde\u5b57\u7b26&#xff09;<\/li>\n<\/ul>\n<p>\u5bf9\u5e94\u7684&#xff0c;\u66f4\u65b0\u540e\u7684\u6253\u5305\u547d\u4ee4\u5e94\u4e3a&#xff1a;<\/p>\n<p>docker compose images <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;FNR &gt; 1 {print <span class=\"token variable\">$2<\/span>&#034;:&#034;<span class=\"token variable\">$3<\/span>}&#039;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">sort<\/span> -u <span class=\"token operator\">|<\/span> <span class=\"token function\">xargs<\/span> docker save -o all_images.tar<\/p>\n<p>\u60a8\u53ef\u4ee5\u901a\u8fc7docker compose version\u6216docker &#8211;version\u68c0\u67e5\u7cfb\u7edf\u4e2d\u7684Docker\u7248\u672c\u548cCompose\u652f\u6301\u60c5\u51b5\u3002<\/p>\n<h4>3.3 \u5b8c\u6574\u7684\u9879\u76ee\u8fc1\u79fb\u6d41\u7a0b<\/h4>\n<p>\u4f7f\u7528Docker\u8fdb\u884c\u9879\u76ee\u8fc1\u79fb\u7684\u5b8c\u6574\u6d41\u7a0b\u5305\u62ec\u4e09\u4e2a\u4e3b\u8981\u6b65\u9aa4&#xff1a;<\/p>\n<li>\n<p>\u6253\u5305\u9636\u6bb5&#xff08;\u6e90\u670d\u52a1\u5668\u4e0a&#xff09;&#xff1a;<\/p>\n<p> <span class=\"token function\">mkdir<\/span> project-backup<br \/>\n<span class=\"token function\">cp<\/span> docker-compose.yml .env config\/* project-backup\/<br \/>\n<span class=\"token function\">mv<\/span> all_images.tar project-backup\/<br \/>\n<span class=\"token function\">tar<\/span> -czvf project-backup.tar.gz project-backup\n <\/li>\n<li>\n<p>\u4f20\u8f93\u9636\u6bb5&#xff1a; \u5c06project-backup.tar.gz\u4f20\u8f93\u5230\u76ee\u6807\u670d\u52a1\u5668&#xff08;\u53ef\u4ee5\u4f7f\u7528scp\u3001rsync\u7b49\u5de5\u5177&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u90e8\u7f72\u9636\u6bb5&#xff08;\u76ee\u6807\u670d\u52a1\u5668\u4e0a&#xff09;&#xff1a;<\/p>\n<p> <span class=\"token function\">tar<\/span> -xzvf project-backup.tar.gz<br \/>\n<span class=\"token builtin class-name\">cd<\/span> project-backup<br \/>\ndocker load -i all_images.tar<br \/>\ndocker-compose up -d\n <\/li>\n<p>\u8fd9\u79cd\u65b9\u6cd5\u7684\u4f18\u52bf\u5728\u4e8e\u53ef\u4ee5\u5b9e\u73b0\u5b8c\u5168\u79bb\u7ebf\u7684\u90e8\u7f72&#xff0c;\u4e0d\u9700\u8981\u76ee\u6807\u670d\u52a1\u5668\u5177\u6709\u4e92\u8054\u7f51\u8fde\u63a5&#xff0c;\u975e\u5e38\u9002\u5408\u5728\u9694\u79bb\u7f51\u7edc\u6216\u6709\u4e25\u683c\u5b89\u5168\u8981\u6c42\u7684\u73af\u5883\u4e2d\u90e8\u7f72Ollama\u548cDify\u9879\u76ee\u3002<\/p>\n<h3>\u603b\u7ed3<\/h3>\n<p>\u5728CPU\u670d\u52a1\u5668\u4e0a\u6210\u529f\u90e8\u7f72Ollama\u548cDify\u73af\u5883\u9700\u8981\u638c\u63e1\u4ee5\u4e0b\u5173\u952e\u8981\u70b9&#xff1a;<\/p>\n<li>Ollama\u90e8\u7f72&#xff1a;\u4f18\u5148\u8003\u8651Docker\u5b89\u88c5\u65b9\u5f0f&#xff0c;\u786e\u4fdd\u6b63\u786e\u914d\u7f6e\u6570\u636e\u5377\u6302\u8f7d\u548c\u7aef\u53e3\u6620\u5c04<\/li>\n<li>Dify\u914d\u7f6e&#xff1a;\u5b9e\u73b0\u4e0eOllama\u7684\u6b63\u786e\u96c6\u6210&#xff0c;\u786e\u4fdd\u6570\u636e\u6301\u4e45\u5316<\/li>\n<li>Docker\u7ba1\u7406&#xff1a;\u638c\u63e1Docker Compose\u7684\u4f7f\u7528&#xff0c;\u719f\u6089\u9879\u76ee\u7684\u6253\u5305\u3001\u8fc1\u79fb\u548c\u90e8\u7f72\u6d41\u7a0b<\/li>\n<p>\u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4&#xff0c;\u60a8\u53ef\u4ee5\u5728\u6807\u51c6CPU\u670d\u52a1\u5668\u4e0a\u6784\u5efa\u4e00\u4e2a\u5b8c\u6574\u7684AI\u5e94\u7528\u5f00\u53d1\u73af\u5883&#xff0c;\u8fd0\u884c\u5927\u8bed\u8a00\u6a21\u578b\u5e76\u57fa\u4e8e\u5b83\u4eec\u6784\u5efa\u5e94\u7528&#xff0c;\u5373\u4f7f\u5728\u79bb\u7ebf\u73af\u5883\u4e2d\u4e5f\u80fd\u9ad8\u6548\u8fd0\u4f5c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf24\u6b21\u3002Ollama\u90e8\u7f72\uff1a\u4f18\u5148\u8003\u8651Docker\u5b89\u88c5\u65b9\u5f0f\uff0c\u786e\u4fdd\u6b63\u786e\u914d\u7f6e\u6570\u636e\u5377\u6302\u8f7d\u548c\u7aef\u53e3\u6620\u5c04Dify\u914d\u7f6e\uff1a\u5b9e\u73b0\u4e0eOllama\u7684\u6b63\u786e\u96c6\u6210\uff0c\u786e\u4fdd\u6570\u636e\u6301\u4e45\u5316Docker\u7ba1\u7406\uff1a\u638c\u63e1Docker Compose\u7684\u4f7f\u7528\uff0c\u719f\u6089\u9879\u76ee\u7684\u6253\u5305\u3001\u8fc1\u79fb\u548c\u90e8\u7f72\u6d41\u7a0b\u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u60a8\u53ef\u4ee5\u5728\u6807\u51c6CPU\u670d\u52a1\u5668\u4e0a\u6784\u5efa\u4e00\u4e2a\u5b8c\u6574\u7684AI\u5e94\u7528\u5f00\u53d1\u73af\u5883\uff0c\u8fd0\u884c\u5927\u8bed\u8a00\u6a21\u578b\u5e76\u57fa\u4e8e\u5b83\u4eec\u6784\u5efa\u5e94\u7528\uff0c\u5373\u4f7f\u5728\u79bb\u7ebf\u73af\u5883\u4e2d\u4e5f\u80fd\u9ad8\u6548\u8fd0\u4f5c\u3002\ud83c\udf89\u8fdb\u5165\u4e91\u7aef\u8fd0\u7ef4\u4e13\u680f\ud83d\ude80\u67e5\u770b\u66f4\u591a\u4e13\u680f\u5185\u5bb9\u3002_docker\u90e8\u7f72ollama\u548cdify linux<\/p>\n","protected":false},"author":2,"featured_media":11051,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[517,43,44],"topic":[],"class_list":["post-11053","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-517","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728CPU\u670d\u52a1\u5668\u4e0a\u90e8\u7f72Ollama\u548cDify\u7684\u8fc7\u7a0b\u8bb0\u5f55 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/11053.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728CPU\u670d\u52a1\u5668\u4e0a\u90e8\u7f72Ollama\u548cDify\u7684\u8fc7\u7a0b\u8bb0\u5f55 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf24\u6b21\u3002Ollama\u90e8\u7f72\uff1a\u4f18\u5148\u8003\u8651Docker\u5b89\u88c5\u65b9\u5f0f\uff0c\u786e\u4fdd\u6b63\u786e\u914d\u7f6e\u6570\u636e\u5377\u6302\u8f7d\u548c\u7aef\u53e3\u6620\u5c04Dify\u914d\u7f6e\uff1a\u5b9e\u73b0\u4e0eOllama\u7684\u6b63\u786e\u96c6\u6210\uff0c\u786e\u4fdd\u6570\u636e\u6301\u4e45\u5316Docker\u7ba1\u7406\uff1a\u638c\u63e1Docker Compose\u7684\u4f7f\u7528\uff0c\u719f\u6089\u9879\u76ee\u7684\u6253\u5305\u3001\u8fc1\u79fb\u548c\u90e8\u7f72\u6d41\u7a0b\u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u60a8\u53ef\u4ee5\u5728\u6807\u51c6CPU\u670d\u52a1\u5668\u4e0a\u6784\u5efa\u4e00\u4e2a\u5b8c\u6574\u7684AI\u5e94\u7528\u5f00\u53d1\u73af\u5883\uff0c\u8fd0\u884c\u5927\u8bed\u8a00\u6a21\u578b\u5e76\u57fa\u4e8e\u5b83\u4eec\u6784\u5efa\u5e94\u7528\uff0c\u5373\u4f7f\u5728\u79bb\u7ebf\u73af\u5883\u4e2d\u4e5f\u80fd\u9ad8\u6548\u8fd0\u4f5c\u3002\ud83c\udf89\u8fdb\u5165\u4e91\u7aef\u8fd0\u7ef4\u4e13\u680f\ud83d\ude80\u67e5\u770b\u66f4\u591a\u4e13\u680f\u5185\u5bb9\u3002_docker\u90e8\u7f72ollama\u548cdify linux\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/11053.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T10:23:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102352-680228384f1c7.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/11053.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/11053.html\",\"name\":\"\u5728CPU\u670d\u52a1\u5668\u4e0a\u90e8\u7f72Ollama\u548cDify\u7684\u8fc7\u7a0b\u8bb0\u5f55 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T10:23:53+00:00\",\"dateModified\":\"2025-04-18T10:23:53+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/11053.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/11053.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/11053.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728CPU\u670d\u52a1\u5668\u4e0a\u90e8\u7f72Ollama\u548cDify\u7684\u8fc7\u7a0b\u8bb0\u5f55\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5728CPU\u670d\u52a1\u5668\u4e0a\u90e8\u7f72Ollama\u548cDify\u7684\u8fc7\u7a0b\u8bb0\u5f55 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/11053.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5728CPU\u670d\u52a1\u5668\u4e0a\u90e8\u7f72Ollama\u548cDify\u7684\u8fc7\u7a0b\u8bb0\u5f55 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf24\u6b21\u3002Ollama\u90e8\u7f72\uff1a\u4f18\u5148\u8003\u8651Docker\u5b89\u88c5\u65b9\u5f0f\uff0c\u786e\u4fdd\u6b63\u786e\u914d\u7f6e\u6570\u636e\u5377\u6302\u8f7d\u548c\u7aef\u53e3\u6620\u5c04Dify\u914d\u7f6e\uff1a\u5b9e\u73b0\u4e0eOllama\u7684\u6b63\u786e\u96c6\u6210\uff0c\u786e\u4fdd\u6570\u636e\u6301\u4e45\u5316Docker\u7ba1\u7406\uff1a\u638c\u63e1Docker Compose\u7684\u4f7f\u7528\uff0c\u719f\u6089\u9879\u76ee\u7684\u6253\u5305\u3001\u8fc1\u79fb\u548c\u90e8\u7f72\u6d41\u7a0b\u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u60a8\u53ef\u4ee5\u5728\u6807\u51c6CPU\u670d\u52a1\u5668\u4e0a\u6784\u5efa\u4e00\u4e2a\u5b8c\u6574\u7684AI\u5e94\u7528\u5f00\u53d1\u73af\u5883\uff0c\u8fd0\u884c\u5927\u8bed\u8a00\u6a21\u578b\u5e76\u57fa\u4e8e\u5b83\u4eec\u6784\u5efa\u5e94\u7528\uff0c\u5373\u4f7f\u5728\u79bb\u7ebf\u73af\u5883\u4e2d\u4e5f\u80fd\u9ad8\u6548\u8fd0\u4f5c\u3002\ud83c\udf89\u8fdb\u5165\u4e91\u7aef\u8fd0\u7ef4\u4e13\u680f\ud83d\ude80\u67e5\u770b\u66f4\u591a\u4e13\u680f\u5185\u5bb9\u3002_docker\u90e8\u7f72ollama\u548cdify linux","og_url":"https:\/\/www.wsisp.com\/helps\/11053.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T10:23:53+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102352-680228384f1c7.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/11053.html","url":"https:\/\/www.wsisp.com\/helps\/11053.html","name":"\u5728CPU\u670d\u52a1\u5668\u4e0a\u90e8\u7f72Ollama\u548cDify\u7684\u8fc7\u7a0b\u8bb0\u5f55 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T10:23:53+00:00","dateModified":"2025-04-18T10:23:53+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/11053.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/11053.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/11053.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5728CPU\u670d\u52a1\u5668\u4e0a\u90e8\u7f72Ollama\u548cDify\u7684\u8fc7\u7a0b\u8bb0\u5f55"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/11053","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=11053"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/11053\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/11051"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=11053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=11053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=11053"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=11053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}