{"id":423625,"date":"2024-12-03T21:25:22","date_gmt":"2024-12-03T13:25:22","guid":{"rendered":"https:\/\/www.idc.net\/help\/423625\/"},"modified":"2024-12-03T21:25:22","modified_gmt":"2024-12-03T13:25:22","slug":"%e4%bd%bf%e7%94%a8docker%e5%ae%89%e8%a3%85mattermost%e7%9a%84%e6%95%99%e7%a8%8b-3","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/423625\/","title":{"rendered":"\u4f7f\u7528Docker\u5b89\u88c5Mattermost\u7684\u6559\u7a0b"},"content":{"rendered":"<h1 id=\"%e4%bd%bf%e7%94%a8docker%e5%ae%89%e8%a3%85mattermost%e7%9a%84%e6%95%99%e7%a8%8b-BfhwRJExfj\">\u4f7f\u7528Docker\u5b89\u88c5Mattermost\u7684\u6559\u7a0b<\/h1>\n<p>Mattermost\u662f\u4e00\u6b3e\u5f00\u6e90\u7684\u56e2\u961f\u534f\u4f5c\u5de5\u5177\uff0c\u63d0\u4f9b\u5373\u65f6\u6d88\u606f\u3001\u6587\u4ef6\u5171\u4eab\u548c\u9879\u76ee\u7ba1\u7406\u7b49\u529f\u80fd\u3002\u5b83\u7684\u7075\u6d3b\u6027\u548c\u53ef\u6269\u5c55\u6027\u4f7f\u5176\u6210\u4e3a\u8bb8\u591a\u4f01\u4e1a\u548c\u56e2\u961f\u7684\u9996\u9009\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Docker\u6765\u5b89\u88c5Mattermost\uff0c\u4ee5\u4fbf\u5feb\u901f\u642d\u5efa\u4e00\u4e2a\u9ad8\u6548\u7684\u56e2\u961f\u6c9f\u901a\u5e73\u53f0\u3002<\/p>\n<h2 id=\"%e5%89%8d%e6%9c%9f%e5%87%86%e5%a4%87-BfhwRJExfj\">\u524d\u671f\u51c6\u5907<\/h2>\n<p>\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u786e\u4fdd\u4f60\u7684\u7cfb\u7edf\u4e0a\u5df2\u7ecf\u5b89\u88c5\u4e86Docker\u548cDocker Compose\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5Docker\u662f\u5426\u5df2\u5b89\u88c5\uff1a<\/p>\n<pre><code>docker --version<\/code><\/pre>\n<p>\u5982\u679c\u672a\u5b89\u88c5Docker\uff0c\u53ef\u4ee5\u53c2\u8003Docker\u7684\u5b98\u65b9\u6587\u6863\u8fdb\u884c\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u786e\u4fddDocker\u670d\u52a1\u6b63\u5728\u8fd0\u884c\u3002<\/p>\n<h2 id=\"%e5%88%9b%e5%bb%bamattermost%e7%9a%84docker-compose%e6%96%87%e4%bb%b6-BfhwRJExfj\">\u521b\u5efaMattermost\u7684Docker Compose\u6587\u4ef6<\/h2>\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e00\u4e2aDocker Compose\u6587\u4ef6\u6765\u5b9a\u4e49Mattermost\u7684\u670d\u52a1\u3002\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>docker-compose.yml<\/code>\u7684\u6587\u4ef6\uff0c\u5e76\u5728\u5176\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre><code>version: '3'\n\nservices:\n  db:\n    image: postgres:13\n    restart: always\n    environment:\n      POSTGRES_USER: mattermost\n      POSTGRES_PASSWORD: password\n      POSTGRES_DB: mattermost\n    volumes:\n      - db_data:\/var\/lib\/postgresql\/data\n\n  mattermost:\n    image: mattermost\/mattermost-team-edition:latest\n    restart: always\n    environment:\n      MM_DB_DRIVER: postgres\n      MM_DB_SOURCE: postgres:\/\/mattermost:password@db:5432\/mattermost?sslmode=disable\n      MM_SERVICESETTINGS_SITEURL: http:\/\/localhost:8065\n    ports:\n      - \"8065:8065\"\n    volumes:\n      - mattermost_data:\/mattermost\/data\n    depends_on:\n      - db\n\nvolumes:\n  db_data:\n  mattermost_data:<\/code><\/pre>\n<p>\u5728\u8fd9\u4e2a\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u6211\u4eec\u5b9a\u4e49\u4e86\u4e24\u4e2a\u670d\u52a1\uff1a\u4e00\u4e2a\u662fPostgreSQL\u6570\u636e\u5e93\uff0c\u53e6\u4e00\u4e2a\u662fMattermost\u5e94\u7528\u3002\u8bf7\u6ce8\u610f\uff0c<code>MM_DB_SOURCE<\/code>\u4e2d\u7684\u5bc6\u7801\u9700\u8981\u4e0e\u6570\u636e\u5e93\u670d\u52a1\u4e2d\u7684<code>POSTGRES_PASSWORD<\/code>\u4e00\u81f4\u3002<\/p>\n<h2 id=\"%e5%90%af%e5%8a%a8mattermost-BfhwRJExfj\">\u542f\u52a8Mattermost<\/h2>\n<p>\u5728\u7ec8\u7aef\u4e2d\uff0c\u5bfc\u822a\u5230\u5305\u542b<code>docker-compose.yml<\/code>\u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u5e76\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u542f\u52a8Mattermost\uff1a<\/p>\n<pre><code>docker-compose up -d<\/code><\/pre>\n<p>\u8be5\u547d\u4ee4\u4f1a\u5728\u540e\u53f0\u542f\u52a8Mattermost\u548c\u6570\u636e\u5e93\u670d\u52a1\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u670d\u52a1\u7684\u72b6\u6001\uff1a<\/p>\n<pre><code>docker-compose ps<\/code><\/pre>\n<h2 id=\"%e8%ae%bf%e9%97%aemattermost-BfhwRJExfj\">\u8bbf\u95eeMattermost<\/h2>\n<p>Mattermost\u9ed8\u8ba4\u8fd0\u884c\u57288065\u7aef\u53e3\u3002\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8bbf\u95ee<code>http:\/\/localhost:8065<\/code>\uff0c\u4f60\u5c06\u770b\u5230Mattermost\u7684\u6b22\u8fce\u9875\u9762\u3002\u6839\u636e\u63d0\u793a\u521b\u5efa\u7ba1\u7406\u5458\u8d26\u6237\u5e76\u8bbe\u7f6e\u56e2\u961f\u4fe1\u606f\u3002<\/p>\n<h2 id=\"%e6%95%b0%e6%8d%ae%e6%8c%81%e4%b9%85%e5%8c%96-BfhwRJExfj\">\u6570\u636e\u6301\u4e45\u5316<\/h2>\n<p>\u5728\u4e0a\u8ff0\u914d\u7f6e\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u4e86Docker\u5377\u6765\u6301\u4e45\u5316\u6570\u636e\u5e93\u548cMattermost\u7684\u6570\u636e\u3002\u8fd9\u610f\u5473\u7740\u5373\u4f7f\u4f60\u505c\u6b62\u6216\u5220\u9664\u5bb9\u5668\uff0c\u6570\u636e\u4ecd\u7136\u4f1a\u4fdd\u7559\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5377\u7684\u72b6\u6001\uff1a<\/p>\n<pre><code>docker volume ls<\/code><\/pre>\n<h2 id=\"%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98-BfhwRJExfj\">\u5e38\u89c1\u95ee\u9898<\/h2>\n<ul>\n<li><strong>\u5982\u4f55\u505c\u6b62Mattermost\u670d\u52a1\uff1f<\/strong><br \/>\u4f7f\u7528\u547d\u4ee4 <code>docker-compose down<\/code> \u505c\u6b62\u670d\u52a1\u3002<\/li>\n<li><strong>\u5982\u4f55\u67e5\u770b\u65e5\u5fd7\uff1f<\/strong><br \/>\u4f7f\u7528\u547d\u4ee4 <code>docker-compose logs<\/code> \u67e5\u770b\u670d\u52a1\u65e5\u5fd7\u3002<\/li>\n<li><strong>\u5982\u4f55\u66f4\u65b0Mattermost\uff1f<\/strong><br \/>\u66f4\u65b0<code>docker-compose.yml<\/code>\u4e2d\u7684\u955c\u50cf\u7248\u672c\uff0c\u7136\u540e\u8fd0\u884c <code>docker-compose pull<\/code> \u548c <code>docker-compose up -d<\/code>\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%80%bb%e7%bb%93-BfhwRJExfj\">\u603b\u7ed3<\/h2>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u8f7b\u677e\u5730\u4f7f\u7528Docker\u5b89\u88c5Mattermost\uff0c\u642d\u5efa\u4e00\u4e2a\u9ad8\u6548\u7684\u56e2\u961f\u534f\u4f5c\u5e73\u53f0\u3002Mattermost\u7684\u7075\u6d3b\u6027\u548c\u53ef\u6269\u5c55\u6027\u4f7f\u5176\u9002\u7528\u4e8e\u5404\u79cd\u89c4\u6a21\u7684\u56e2\u961f\u3002\u5982\u679c\u4f60\u9700\u8981\u66f4\u5f3a\u5927\u7684\u670d\u52a1\u5668\u652f\u6301\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u540e\u6d6a\u4e91\u63d0\u4f9b\u7684<a href=\"https:\/\/idc.net\">\u4e91\u670d\u52a1\u5668<\/a>\uff0c\u5982\u9999\u6e2fVPS\u6216\u7f8e\u56fdVPS\uff0c\u6765\u786e\u4fdd\u4f60\u7684Mattermost\u8fd0\u884c\u6d41\u7545\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b66\u4e60\u5982\u4f55\u4f7f\u7528Docker\u5feb\u901f\u5b89\u88c5Mattermost\uff0c\u8f7b\u677e\u642d\u5efa\u56e2\u961f\u534f\u4f5c\u5e73\u53f0\uff0c\u63d0\u5347\u5de5\u4f5c\u6548\u7387\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[202757],"tags":[],"class_list":["post-423625","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/423625","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=423625"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/423625\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=423625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=423625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=423625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}