{"id":1532,"date":"2020-03-04T10:31:18","date_gmt":"2020-03-04T01:31:18","guid":{"rendered":"https:\/\/qol-kk.com\/wp2\/?p=1532"},"modified":"2020-03-04T10:31:18","modified_gmt":"2020-03-04T01:31:18","slug":"post-1532","status":"publish","type":"post","link":"https:\/\/qol-kk.com\/wp2\/blog\/2020\/03\/04\/post-1532\/","title":{"rendered":"Docker\u30b3\u30f3\u30c6\u30ca\u306e\u81ea\u52d5\u8d77\u52d5\u304c\u8d85\u7c21\u5358\u3060\u3063\u305f\u4ef6"},"content":{"rendered":"<h2>Docker\u30b3\u30f3\u30c6\u30ca\u306e\u81ea\u52d5\u8d77\u52d5\u304c\u8d85\u7c21\u5358\u3060\u3063\u305f\u4ef6<\/h2>\n<p>\u8272\u3005\u3068\u7d44\u307f\u3042\u304c\u3063\u3066\u304d\u305f\u306e\u3067\u3001Docker\u3092\u53ce\u3081\u305f\u30b5\u30fc\u30d0\u30fc\u3092\u518d\u8d77\u52d5\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u3059\u308b\u3068...\u30b5\u30a4\u30c8\u304c\u7acb\u3061\u4e0a\u304c\u3089\u306a\u3044\u3002<\/p>\n<p>\u3068\u8a00\u3046\u4e8b\u3067\u3001Docker\u30b3\u30f3\u30c6\u30ca\u306e\u81ea\u52d5\u8d77\u52d5\u306b\u3064\u3044\u3066\u5099\u5fd8\u9332\u3067\u3059\u3002<\/p>\n<h3>\u81ea\u52d5\u8d77\u52d5\u306e\u8a2d\u5b9a\u65b9\u6cd5<\/h3>\n<p>\u3053\u308c\u304c\u9a5a\u304f\u307b\u3069\u7c21\u5358\u3067\u300edocker-compose.yml \u306e\u5404\u30a4\u30e1\u30fc\u30b8\u306b1\u6587\u52a0\u3048\u308b\u3060\u3051\u300f\u3067\u3059\u3002<\/p>\n<div class=\"pointBox\" style=\"text-align: center;\"><span class=\"markerPink\"><strong>restart: always<\/strong><\/span><\/div>\n<p>\u4e8b\u524d\u306b\u4ed5\u639b\u3051\u3066\u7f6e\u3051\u3070\u30b7\u30b9\u30c6\u30e0\u30b3\u30d4\u30fc\u3067\u300c\u30e4\u30d0\u30a4\u3001\u3084\u308a\u5fd8\u308c\u305f\uff01\u300d\u3068\u3044\u3046\u4e8b\u304c\u7121\u3044\u3068\u3002<\/p>\n<p>\u512a\u79c0\u3060\u3002<\/p>\n<pre class=\"lang:default decode:true \">$ sudo vim docker-compose.yml<\/pre>\n<pre class=\"lang:default decode:true \">version: '3'\r\nservices:\r\n  web:\r\n    image: nginx:1.15.6\r\n    container_name: NGINX\r\n    ports:\r\n      - \"8000:80\"\r\n    depends_on:\r\n      - app\r\n    volumes:\r\n      - .\/docker\/web\/default.conf:\/etc\/nginx\/conf.d\/default.conf\r\n      - .:\/var\/www\/html\r\n    #\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a\r\n    restart: always\r\n\r\n  app:\r\n    container_name: PHP\r\n    build: .\/docker\/php\r\n    depends_on:\r\n      - mysql\r\n    volumes:\r\n      - .\/docker\/app\/php.ini:\/usr\/local\/etc\/php\/php.ini\r\n      - .:\/var\/www\/html\r\n    #\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a\r\n    restart: always<\/pre>\n<h3>\u81ea\u52d5\u8a2d\u5b9a\u3092\u4ed5\u639b\u3051\u305f\u6642\u306e\u6ce8\u610f\u70b9<\/h3>\n<p>docker-compose.yml \u306b restart: always \u3092\u66f8\u304d\u8fbc\u3080\u3060\u3051\u3067\u306f\u518d\u8d77\u52d5\u3057\u3066\u3082\u81ea\u52d5\u8d77\u52d5\u3057\u3066\u304f\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u4f55\u6545\u304b\u3002<br \/>\n\u305f\u3060\u66f8\u3044\u305f\u3060\u3051\u3067\u306f\u3001\u4f5c\u6210\u3055\u308c\u305f\u30a4\u30e1\u30fc\u30b8\u306b\u81ea\u52d5\u8d77\u52d5\u304c\u4ed5\u8fbc\u307e\u308c\u3066\u3044\u306a\u3044\u304b\u3089\u3067\u3059\u3002<br \/>\n\u305d\u306e\u70ba\u3001\u518d\u8d77\u52d5\u306e\u524d\u306b\u4ee5\u4e0b\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30e1\u30fc\u30b8\u3092\u30ea\u30d3\u30eb\u30c9\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">$ sudo \/usr\/local\/bin\/docker-compose up -d<\/pre>\n<p>\u3082\u3061\u308d\u3093\u3001Docker\u4e8b\u614b\u306b\u81ea\u52d5\u8d77\u52d5\u304c\u4ed5\u8fbc\u307e\u308c\u3066\u3044\u306a\u3044\u3068\u30c0\u30e1\u306a\u306e\u3067\u3001\u4e0a\u624b\u304f\u3044\u304b\u306a\u3044\u6642\u306fDocker\u81ea\u8eab\u306e\u81ea\u52d5\u8d77\u52d5\u3082\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>Docker\u30b5\u30fc\u30d3\u30b9\u306e\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a<\/p>\n<pre class=\"lang:default decode:true\">$ sudo systemctl enable docker<\/pre>\n<h3>\u307e\u3068\u3081<\/h3>\n<p>\u30e4\u30d0\u3044\u3001Docker\u8d85\u4fbf\u5229\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Docker\u30b3\u30f3\u30c6\u30ca\u306e\u81ea\u52d5\u8d77\u52d5\u304c\u8d85\u7c21\u5358\u3060\u3063\u305f\u4ef6 \u8272\u3005\u3068\u7d44\u307f\u3042\u304c\u3063\u3066\u304d\u305f\u306e\u3067\u3001Docker\u3092\u53ce\u3081\u305f\u30b5\u30fc\u30d0\u30fc\u3092\u518d\u8d77\u52d5\u3057\u3066\u307f\u307e\u3057\u305f\u3002 \u3059\u308b\u3068...\u30b5\u30a4\u30c8\u304c\u7acb\u3061\u4e0a\u304c\u3089\u306a\u3044\u3002 \u3068\u8a00\u3046\u4e8b\u3067\u3001Docker\u30b3\u30f3\u30c6\u30ca\u306e\u81ea\u52d5\u8d77\u52d5\u306b\u3064\u3044\u3066\u5099\u5fd8 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1502,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[75],"tags":[489,498,515,516,53,49,500,514,45,68,385],"class_list":["post-1532","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code-of-serverside","tag-centos7","tag-docker","tag-515","tag-516","tag-53","tag-49","tag-500","tag-514","tag-45","tag-68","tag-385"],"veu_head_title_object":{"title":"","add_site_title":""},"jetpack_publicize_connections":[],"jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/qol-kk.com\/wp2\/wp-content\/uploads\/2020\/02\/https___www.creationline.com_wp-content_uploads_2018_06_Moby2018.png","_links":{"self":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts\/1532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/comments?post=1532"}],"version-history":[{"count":0,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts\/1532\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/media\/1502"}],"wp:attachment":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/media?parent=1532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/categories?post=1532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/tags?post=1532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}