{"id":893,"date":"2026-03-27T08:13:31","date_gmt":"2026-03-27T08:13:31","guid":{"rendered":"https:\/\/opshub.com.cn\/?p=893"},"modified":"2026-03-27T08:14:16","modified_gmt":"2026-03-27T08:14:16","slug":"docker%e6%9e%84%e5%bb%bapython3%e8%bf%90%e8%a1%8c%e7%8e%af%e5%a2%83%e5%ae%89%e8%a3%85flask%e3%80%81transformers%e3%80%81torch%e3%80%81sentencepiece%e3%80%81protobuf%e3%80%81accelerate-6%e4%b8%aa","status":"publish","type":"post","link":"https:\/\/opshub.com.cn\/?p=893","title":{"rendered":"docker\u6784\u5efapython3\u8fd0\u884c\u73af\u5883\u5b89\u88c5flask\u3001transformers\u3001torch\u3001sentencepiece\u3001protobuf\u3001accelerate 6\u4e2a\u4f9d\u8d56"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>FROM debian:12.11\nRUN \/bin\/rm -f \/etc\/apt\/sources.list.d\/debian.sources &amp;&amp; \\\n    echo \"deb http:\/\/mirrors.nju.edu.cn\/debian\/ bookworm main contrib non-free\" > \/etc\/apt\/sources.list &amp;&amp; \\\n    echo \"deb http:\/\/mirrors.nju.edu.cn\/debian\/ bookworm-updates main contrib non-free\" >> \/etc\/apt\/sources.list &amp;&amp; \\\n    echo \"deb http:\/\/mirrors.nju.edu.cn\/debian-security bookworm-security\/updates main contrib non-free\" >> \/etc\/apt\/sources.list &amp;&amp; \\\n    apt-get update &amp;&amp; \\\n    apt-get install -y python3 python3-pip python3-venv &amp;&amp; \\\n    \/bin\/rm -rf \/var\/lib\/apt\/lists\/* &amp;&amp; \\\n    \/bin\/mv \/usr\/lib\/python3.11\/EXTERNALLY-MANAGED \/usr\/lib\/python3.11\/EXTERNALLY-MANAGED.bak &amp;&amp; \\\n    pip install -i https:\/\/mirrors.huaweicloud.com\/repository\/pypi\/simple --no-cache-dir flask &amp;&amp; \\\n    pip install -i https:\/\/mirrors.huaweicloud.com\/repository\/pypi\/simple --no-cache-dir transformers &amp;&amp; \\\n    pip install -i https:\/\/mirrors.huaweicloud.com\/repository\/pypi\/simple --no-cache-dir torch &amp;&amp; \\\n    pip install -i https:\/\/mirrors.huaweicloud.com\/repository\/pypi\/simple --no-cache-dir sentencepiece &amp;&amp; \\\n    pip install -i https:\/\/mirrors.huaweicloud.com\/repository\/pypi\/simple --no-cache-dir protobuf &amp;&amp; \\\n    pip install -i https:\/\/mirrors.huaweicloud.com\/repository\/pypi\/simple --no-cache-dir accelerate\nWORKDIR \/app\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>services:\n  rerankmodel:\n    image: python-rerankmodel:0.1\n    container_name: rerankmodel\n    environment:\n      TZ: \"Asia\/Shanghai\"\n    volumes:\n      - .\/rerankmodel:\/app:rw\n    ports:\n      - \"5001:5001\"\n    working_dir: \/app\n    entrypoint: &#91;\"python3\",\"-u\",\"rerank.py\"]<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-893","post","type-post","status-publish","format-standard","hentry","category-dockerkubernetes"],"_links":{"self":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=893"}],"version-history":[{"count":1,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/893\/revisions"}],"predecessor-version":[{"id":895,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/893\/revisions\/895"}],"wp:attachment":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}