{"id":196413,"date":"2020-07-27T08:10:41","date_gmt":"2020-07-27T00:10:41","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=196413"},"modified":"2020-07-20T09:11:40","modified_gmt":"2020-07-20T01:11:40","slug":"php-docker-environment","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/php-docker-environment.html","title":{"rendered":"\u4f7f\u7528 Docker \u5f00\u53d1 PHP \u9879\u76ee\uff08\u4e94\uff09\uff1a\u751f\u4ea7\u73af\u5883"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nDocker\u5305\u62ec swarm \u6a21\u5f0f\uff0c\u7528\u4e8e\u539f\u751f\u7ba1\u7406\u79f0\u4e3a swarm \u7684 Docker \u5f15\u64ce\u96c6\u7fa4;\u4f7f\u7528 Docker CLI \u521b\u5efa\u4e00\u4e2a swarm\uff0c\u5c06\u5e94\u7528\u670d\u52a1\u90e8\u7f72\u5230 swarm\uff0c\u5e76\u7ba1\u7406 swarm \u884c\u4e3a\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

Docker \u5316 PHP \u9879\u76ee<\/strong><\/span><\/div>\n

\u6bcf\u4e2a PHP \u9879\u76ee\u4e2d\u5fc5\u987b\u5305\u542b\u4ee5\u4e0b\u6587\u4ef6<\/p>\n

\r\nDockerfile\r\n.env\r\ndocker-compose.yml\r\n<\/pre>\n

\u793a\u4f8b\u8bf7\u67e5\u770b .\/app\/demo<\/p>\n

Docker \u5316 NGINX<\/strong><\/span><\/div>\n

\u793a\u4f8b\u8bf7\u67e5\u770b .\/config\/nginx\/Dockerfile<\/p>\n

Secret<\/strong><\/span><\/div>\n

SSH key<\/p>\n

Configs<\/strong><\/span><\/div>\n

PHP \u914d\u7f6e\u6587\u4ef6<\/p>\n

NGINX \u914d\u7f6e\u6587\u4ef6<\/p>\n

\u542f\u52a8<\/strong><\/span><\/div>\n

\u5728 docker-production.yml \u4e2d\u5b9a\u4e49\uff0c\u8bf7\u81ea\u884c\u8c03\u6574\u914d\u7f6e<\/p>\n

\r\n$ .\/lnmp-dcoker.sh swarm-deploy\r\n<\/pre>\n
\u9500\u6bc1<\/strong><\/span><\/div>\n
\r\n$ .\/lnmp-docker.sh swarm-down\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

\u6bcf\u4e2a PHP \u9879\u76ee\u4e2d\u5fc5\u987b\u5305\u542b\u4ee5\u4e0b\u6587\u4ef6 Dockerfile .env docker-compose.yml \u793a […]<\/p>\n","protected":false},"author":1479,"featured_media":196434,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-196413","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/196413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1479"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=196413"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/196413\/revisions"}],"predecessor-version":[{"id":196435,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/196413\/revisions\/196435"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/196434"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=196413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=196413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=196413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}