{"id":505,"date":"2023-04-15T13:42:31","date_gmt":"2023-04-23T06:42:21","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/docker-compose%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6wordpress%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95%e3%82%92%e6%95%99%e3%81%88\/"},"modified":"2025-08-01T00:06:35","modified_gmt":"2025-07-31T15:06:35","slug":"docker-compose%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6wordpress%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95%e3%82%92%e6%95%99%e3%81%88","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/docker-compose%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6wordpress%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95%e3%82%92%e6%95%99%e3%81%88\/","title":{"rendered":"Docker Compose\u3092\u4f7f\u7528\u3057\u3066WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002"},"content":{"rendered":"<h3>\u4ee5\u4e0b\u306e\u65e5\u672c\u8a9e\u306e\u81ea\u7136\u306a\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u306f\u4e00\u3064\u3060\u3051\u3067\u3059\u3002<\/h3>\n<p>\u300c\u5e8f\u8ad6\u300d<\/p>\n<p>WordPress\u306f\u3001MySQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068PHP\u51e6\u7406\u3092\u30d9\u30fc\u30b9\u306b\u3057\u305f\u7121\u6599\u3067\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\uff08CMS\uff09\u3067\u3059\u3002\u62e1\u5f35\u53ef\u80fd\u306a\u30d7\u30e9\u30b0\u30a4\u30f3\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3068\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30b7\u30b9\u30c6\u30e0\u306b\u3088\u308a\u3001\u307b\u3068\u3093\u3069\u306e\u7ba1\u7406\u4f5c\u696d\u306f\u30a6\u30a7\u30d6\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u901a\u3058\u3066\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u304cWordPress\u304c\u3001\u30d6\u30ed\u30b0\u304b\u3089\u5546\u54c1\u30da\u30fc\u30b8\u3084e\u30b3\u30de\u30fc\u30b9\u30b5\u30a4\u30c8\u307e\u3067\u3001\u3055\u307e\u3056\u307e\u306a\u7a2e\u985e\u306e\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u3092\u4f5c\u6210\u3059\u308b\u969b\u306b\u4eba\u6c17\u306e\u3042\u308b\u9078\u629e\u80a2\u3067\u3042\u308b\u7406\u7531\u3067\u3059\u3002<\/p>\n<p>WordPress\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u901a\u5e38\u3001LAMP\uff08Linux\u3001Apache\u3001MySQL\u3001\u304a\u3088\u3073PHP\uff09\u307e\u305f\u306fLEMP\uff08Linux\u3001Nginx\u3001MySQL\u3001\u304a\u3088\u3073PHP\uff09\u30b9\u30bf\u30c3\u30af\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u308c\u306b\u306f\u6642\u9593\u304c\u304b\u304b\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u305f\u3060\u3057\u3001Docker\u3084Docker Compose\u306a\u3069\u306e\u30c4\u30fc\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u597d\u307f\u306e\u30b9\u30bf\u30c3\u30af\u3092\u8a2d\u5b9a\u3057WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30d7\u30ed\u30bb\u30b9\u3092\u52b9\u7387\u5316\u3067\u304d\u307e\u3059\u3002\u500b\u3005\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u624b\u52d5\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u4ee3\u308f\u308a\u306b\u3001\u30e9\u30a4\u30d6\u30e9\u30ea\u3001\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3001\u304a\u3088\u3073\u74b0\u5883\u5909\u6570\u306a\u3069\u3092\u6a19\u6e96\u5316\u3059\u308b\u30a4\u30e1\u30fc\u30b8\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002\u305d\u3057\u3066\u3001\u3053\u308c\u3089\u306e\u30a4\u30e1\u30fc\u30b8\u3092\u30b3\u30f3\u30c6\u30ca\u3067\u5b9f\u884c\u3057\u3001\u5171\u6709\u306e\u30aa\u30da\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u30b7\u30b9\u30c6\u30e0\u4e0a\u3067\u52d5\u4f5c\u3059\u308b\u5206\u96e2\u3055\u308c\u305f\u30d7\u30ed\u30bb\u30b9\u3068\u3057\u3066\u5b9f\u884c\u3057\u307e\u3059\u3002\u3055\u3089\u306b\u3001Compose\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306a\u3069\u3001\u8907\u6570\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u9023\u643a\u3055\u305b\u3001\u4e92\u3044\u306b\u901a\u4fe1\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u8907\u6570\u306e\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u306a\u308bWordPress\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u306b\u3064\u3044\u3066\u5b66\u3073\u307e\u3059\u3002\u30b3\u30f3\u30c6\u30ca\u306b\u306fMySQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3001Nginx\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u3001\u305d\u3057\u3066WordPress\u81ea\u4f53\u304c\u542b\u307e\u308c\u307e\u3059\u3002\u307e\u305f\u3001Let&#8217;s Encrypt\u3092\u4f7f\u7528\u3057\u3066\u3001\u30b5\u30a4\u30c8\u306b\u95a2\u9023\u4ed8\u3051\u305f\u3044\u30c9\u30e1\u30a4\u30f3\u7528\u306eTLS\/SSL\u8a3c\u660e\u66f8\u3092\u53d6\u5f97\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u30bb\u30ad\u30e5\u30a2\u306b\u3057\u307e\u3059\u3002\u6700\u5f8c\u306b\u3001\u30c9\u30e1\u30a4\u30f3\u3092\u5b89\u5168\u306b\u4fdd\u3064\u305f\u3081\u3001\u8a3c\u660e\u66f8\u306e\u66f4\u65b0\u3092\u5b9a\u671f\u7684\u306b\u884c\u3046cron\u30b8\u30e7\u30d6\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<h2>\u524d\u63d0\u6761\u4ef6<\/h2>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u5f93\u3046\u305f\u3081\u306b\u306f\u3001\u4ee5\u4e0b\u304c\u5fc5\u8981\u3067\u3059\uff1a<\/p>\n<ul class=\"post-ul\">\n<li>A server running Ubuntu 20.04, along with a non-root user with sudo privileges and an active firewall. For guidance on how to set these up, please read our Initial Server Setup guide.<\/li>\n<li>Docker installed on your server, following Steps 1 and 2 of How To Install and Use Docker on Ubuntu 20.04.<\/li>\n<li>Docker Compose installed on your server, following Step 1 of How To Install Docker Compose on Ubuntu 20.04.<\/li>\n<li>A registered domain name. This tutorial will use your_domain throughout. You can get one for free at Freenom, or use the domain registrar of your choice.<\/li>\n<li>Both of the following DNS records set up for your server. You can follow this introduction to Silicon Cloud DNS for details on how to add them to a Silicon Cloud account:An A record with your_domain pointing to your server\u2019s public IP address.<br \/>\nAn A record with www.your_domain pointing to your server\u2019s public IP address.<\/li>\n<\/ul>\n<p>\u3059\u3079\u3066\u304c\u6e96\u5099\u3067\u304d\u305f\u3089\u3001\u6700\u521d\u306e\u30b9\u30c6\u30c3\u30d7\u3092\u59cb\u3081\u308b\u6e96\u5099\u304c\u6574\u3044\u307e\u3059\u3002 (Subete ga junbi dekitara, saisho no suteppu wo hajimeru junbi ga totonoimasu)<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d71 &#8211; \u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a\u3092\u5b9a\u7fa9\u3059\u308b\u3002<\/h2>\n<p>\u4efb\u610f\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u5b9f\u884c\u3059\u308b\u524d\u306b\u3001\u6700\u521d\u306bNginx\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a\u3092\u5b9a\u7fa9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u306f\u3001WordPress\u56fa\u6709\u306e\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u30d6\u30ed\u30c3\u30af\u3068\u3001\u81ea\u52d5\u7684\u306a\u8a3c\u660e\u66f8\u66f4\u65b0\u306e\u305f\u3081\u306bCertbot\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306bLet&#8217;s Encrypt\u691c\u8a3c\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3059\u308b\u305f\u3081\u306e\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u30d6\u30ed\u30c3\u30af\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u306b\u3001WordPress\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u7528\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u3053\u306e\u4f8b\u3067\u306f\u3001wordpress\u3068\u547c\u3070\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u597d\u304d\u306a\u540d\u524d\u3067\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">mkdir<\/span> wordpress<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u305d\u308c\u304b\u3089\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token builtin class-name\">cd<\/span> wordpress<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6b21\u306b\u3001\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u7528\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">mkdir<\/span> nginx-conf<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>nano\u307e\u305f\u306f\u304a\u6c17\u306b\u5165\u308a\u306e\u30a8\u30c7\u30a3\u30bf\u30fc\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> nginx-conf\/nginx.conf<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u3001\u30b5\u30fc\u30d0\u30fc\u30d6\u30ed\u30c3\u30af\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30b5\u30fc\u30d0\u30fc\u540d\u3068\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30eb\u30fc\u30c8\u306e\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3001\u3055\u3089\u306bCertbot\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u8a3c\u660e\u66f8\u3001PHP\u51e6\u7406\u3001\u9759\u7684\u30a2\u30bb\u30c3\u30c8\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u5411\u3051\u308b\u305f\u3081\u306e\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u30d6\u30ed\u30c3\u30af\u3082\u542b\u3093\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u5fc5\u305ayour_domain\u3092\u81ea\u5206\u306e\u30c9\u30e1\u30a4\u30f3\u540d\u306b\u7f6e\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\n<p>~\/wordpress\/nginx-conf\/nginx.conf\u3092\u65e5\u672c\u8a9e\u3067\u8868\u73fe\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059:<\/p>\n<p>~\/wordpress\/nginx-conf\/nginx.conf<\/p>\n<\/div>\n<pre class=\"post-pre\"><code>server {\r\n        listen 80;\r\n        listen [::]:80;\r\n\r\n        server_name <mark>your_domain<\/mark> www.<mark>your_domain<\/mark>;\r\n\r\n        index index.php index.html index.htm;\r\n\r\n        root \/var\/www\/html;\r\n\r\n        location ~ \/.well-known\/acme-challenge {\r\n                allow all;\r\n                root \/var\/www\/html;\r\n        }\r\n\r\n        location \/ {\r\n                try_files $uri $uri\/ \/index.php$is_args$args;\r\n        }\r\n\r\n        location ~ \\.php$ {\r\n                try_files $uri =404;\r\n                fastcgi_split_path_info ^(.+\\.php)(\/.+)$;\r\n                fastcgi_pass wordpress:9000;\r\n                fastcgi_index index.php;\r\n                include fastcgi_params;\r\n                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n                fastcgi_param PATH_INFO $fastcgi_path_info;\r\n        }\r\n\r\n        location ~ \/\\.ht {\r\n                deny all;\r\n        }\r\n        \r\n        location = \/favicon.ico { \r\n                log_not_found off; access_log off; \r\n        }\r\n        location = \/robots.txt { \r\n                log_not_found off; access_log off; allow all; \r\n        }\r\n        location ~* \\.(css|gif|ico|jpeg|jpg|js|png)$ {\r\n                expires max;\r\n                log_not_found off;\r\n        }\r\n}\r\n<\/code><\/pre>\n<p>\u79c1\u305f\u3061\u306e\u30b5\u30fc\u30d0\u30fc\u30d6\u30ed\u30c3\u30af\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u60c5\u5831\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6307\u4ee4\uff1a<\/p>\n<ul class=\"post-ul\">\n<li>listen: This tells Nginx to listen on port 80, which will allow you to use Certbot\u2019s webroot plugin for your certificate requests. Note that you are not including port 443 yet \u2014 you will update your configuration to include SSL once you have successfully obtained your certificates.<\/li>\n<li>server_name: This defines your server name and the server block that should be used for requests to your server. Be sure to replace your_domain in this line with your own domain name.<\/li>\n<li>index: This directive defines the files that will be used as indexes when processing requests to your server. You modified the default order of priority here, moving index.php in front of index.html so that Nginx prioritizes files called index.php when possible.<\/li>\n<li>root: This directive names the root directory for requests to your server. This directory, \/var\/www\/html, is created as a mount point at build time by instructions in your WordPress Dockerfile. These Dockerfile instructions also ensure that the files from the WordPress release are mounted to this volume.<\/li>\n<\/ul>\n<p>\u5834\u6240\u30d6\u30ed\u30c3\u30af<\/p>\n<ul class=\"post-ul\">\n<li>location ~ \/.well-known\/acme-challenge: This location block will handle requests to the .well-known directory, where Certbot will place a temporary file to validate that the DNS for your domain resolves to your server. With this configuration in place, you will be able to use Certbot\u2019s webroot plugin to obtain certificates for your domain.<\/li>\n<li>location \/: In this location block, a try_files directive is used to check for files that match individual URI requests. Instead of returning a 404 Not Found status as a default, however, you\u2019ll pass control to WordPress\u2019s index.php file with the request arguments.<\/li>\n<li>location ~ \\.php$: This location block will handle PHP processing and proxy these requests to your wordpress container. Because your WordPress Docker image will be based on the php:fpm image, you will also include configuration options that are specific to the FastCGI protocol in this block. Nginx requires an independent PHP processor for PHP requests. In this case, these requests will be handled by the php-fpm processor that\u2019s included with the php:fpm image.<br \/>\nAdditionally, this location block includes FastCGI-specific directives, variables, and options that will proxy requests to the WordPress application running in your wordpress container, set the preferred index for the parsed request URI, and parse URI requests.<\/li>\n<li>location ~ \/\\.ht: This block will handle .htaccess files since Nginx won\u2019t serve them. The deny_all directive ensures that .htaccess files will never be served to users.<\/li>\n<li>location = \/favicon.ico, location = \/robots.txt: These blocks ensure that requests to \/favicon.ico and \/robots.txt will not be logged.<\/li>\n<li>location ~* \\.(css|gif|ico|jpeg|jpg|js|png)$: This block turns off logging for static asset requests and ensures that these assets are highly cacheable, as they are typically expensive to serve.<\/li>\n<\/ul>\n<p>FastCGI\u30d7\u30ed\u30ad\u30b7\u306b\u95a2\u3059\u308b\u8a73\u7d30\u306f\u3001Nginx\u3067\u306eFastCGI\u30d7\u30ed\u30ad\u30b7\u306e\u7406\u89e3\u3068\u5b9f\u88c5\u3092\u8aad\u3093\u3067\u304f\u3060\u3055\u3044\u3002\u30b5\u30fc\u30d0\u30fc\u304a\u3088\u3073\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u30d6\u30ed\u30c3\u30af\u306b\u95a2\u3059\u308b\u60c5\u5831\u306b\u3064\u3044\u3066\u306f\u3001Nginx\u306e\u30b5\u30fc\u30d0\u30fc\u304a\u3088\u3073\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u30d6\u30ed\u30c3\u30af\u306e\u9078\u629e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u7406\u89e3\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u7de8\u96c6\u304c\u7d42\u308f\u3063\u305f\u3089\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002\u3082\u3057nano\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001CTRL+X\u3001Y\u3001\u305d\u3057\u3066ENTER\u3092\u62bc\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>Nginx\u306e\u8a2d\u5b9a\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30b3\u30f3\u30c6\u30ca\u306b\u5b9f\u884c\u6642\u306b\u6e21\u3059\u305f\u3081\u306e\u74b0\u5883\u5909\u6570\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d7\uff12\uff1a\u74b0\u5883\u5909\u6570\u306e\u5b9a\u7fa9<\/h2>\n<p>\u30e9\u30f3\u30bf\u30a4\u30e0\u3067\u30a2\u30af\u30bb\u30b9\u304c\u5fc5\u8981\u306a\u74b0\u5883\u5909\u6570\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u306b\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068WordPress\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b3\u30f3\u30c6\u30ca\u306b\u3088\u308a\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf\u304c\u6c38\u7d9a\u5316\u3055\u308c\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u30a2\u30af\u30bb\u30b9\u53ef\u80fd\u306b\u306a\u308b\u305f\u3081\u306e\u3001\u30bb\u30f3\u30b7\u30c6\u30a3\u30d6\u306a\u5024\uff08MySQL\u306e\u30eb\u30fc\u30c8\u30d1\u30b9\u30ef\u30fc\u30c9\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30e6\u30fc\u30b6\u30fc\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\uff09\u3068\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d\u3068\u30db\u30b9\u30c8\u306e\u975e\u30bb\u30f3\u30b7\u30c6\u30a3\u30d6\u306a\u60c5\u5831\u304c\u542b\u307e\u308c\u307e\u3059\u3002<\/p>\n<p>Docker Compose\u30d5\u30a1\u30a4\u30eb\u306b\u3053\u308c\u3089\u306e\u5024\u3092\u3059\u3079\u3066\u8a2d\u5b9a\u3059\u308b\u3088\u308a\u3082\u3001\u6a5f\u5bc6\u60c5\u5831\u3092.env\u30d5\u30a1\u30a4\u30eb\u306b\u8a2d\u5b9a\u3057\u3001\u305d\u306e\u6d41\u901a\u3092\u5236\u9650\u3057\u307e\u3057\u3087\u3046\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u3053\u308c\u3089\u306e\u5024\u304c\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u30b3\u30d4\u30fc\u3055\u308c\u3066\u516c\u958b\u3055\u308c\u308b\u3053\u3068\u3092\u9632\u3050\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30e1\u30a4\u30f3\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u3042\u308b~\/wordpress\u5185\u306e.env\u3068\u3044\u3046\u540d\u524d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> .env<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u8a2d\u5b9a\u3059\u308b\u6a5f\u5bc6\u60c5\u5831\u306b\u306f\u3001MySQL\u306e\u30eb\u30fc\u30c8\u30e6\u30fc\u30b6\u30fc\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3001\u304a\u3088\u3073WordPress\u304c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u540d\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u5909\u6570\u540d\u3068\u5024\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u5404\u5909\u6570\u306b\u3064\u3044\u3066\u306f\u3001\u72ec\u81ea\u306e\u5024\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>~\/wordpress\/.env\u3000\u2192\u3000\uff5e\/wordpress\/.env<\/div>\n<pre class=\"post-pre\"><code>MYSQL_ROOT_PASSWORD=<mark>your_root_password<\/mark>\r\nMYSQL_USER=<mark>your_wordpress_database_user<\/mark>\r\nMYSQL_PASSWORD=<mark>your_wordpress_database_password<\/mark>\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u3082\u306e\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\uff1a\u7ba1\u7406\u8005\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u30eb\u30fc\u30c8\u30d1\u30b9\u30ef\u30fc\u30c9\u3001\u305d\u3057\u3066\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<p>\u7de8\u96c6\u304c\u7d42\u308f\u3063\u305f\u3089\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3042\u306a\u305f\u306e. env\u30d5\u30a1\u30a4\u30eb\u306b\u306f\u6a5f\u5bc6\u60c5\u5831\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e.gitignore\u30d5\u30a1\u30a4\u30eb\u3068.dockerignore\u30d5\u30a1\u30a4\u30eb\u306b\u542b\u307e\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001Git\u3068Docker\u306f\u305d\u308c\u305e\u308cGit\u30ea\u30dd\u30b8\u30c8\u30ea\u3068Docker\u30a4\u30e1\u30fc\u30b8\u306b\u30b3\u30d4\u30fc\u3057\u306a\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3068\u3057\u3066Git\u3092\u4f7f\u7528\u3059\u308b\u4e88\u5b9a\u306a\u3089\u3001git init\u3067\u73fe\u5728\u306e\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30ea\u30dd\u30b8\u30c8\u30ea\u3068\u3057\u3066\u521d\u671f\u5316\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">git<\/span> init<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u305d\u308c\u304b\u3089\u3001.gitignore\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u958b\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> .gitignore<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u306b .env \u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>~\/wordpress\/.gitignore\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u308b\u3068\u3001\u300c~\/wordpress\/.gitignore\u3092\u7121\u8996\u3059\u308b\u300d\u3068\u306a\u308a\u307e\u3059\u3002<\/div>\n<pre class=\"post-pre\"><code>.env\r\n<\/code><\/pre>\n<p>\u7de8\u96c6\u304c\u7d42\u308f\u3063\u305f\u3089\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u540c\u69d8\u306b\u3001\u30d3\u30eb\u30c9\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3068\u3057\u3066\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u3001.env\u30d5\u30a1\u30a4\u30eb\u3092.dockerignore\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3059\u308b\u3053\u3068\u306f\u91cd\u8981\u306a\u4e88\u9632\u63aa\u7f6e\u3067\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30b3\u30f3\u30c6\u30ca\u306b\u542b\u307e\u308c\u306a\u3044\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> .dockerignore<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u306b.env\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>~\/wordpress\/.dockerignore\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u300c\u30ef\u30fc\u30c9\u30d7\u30ec\u30b9\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306e.dockerignore\u30d5\u30a1\u30a4\u30eb\u300d<\/div>\n<pre class=\"post-pre\"><code>.env\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306b\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u306b\u95a2\u9023\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u3084\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4efb\u610f\u3067\u8ffd\u52a0\u3067\u304d\u307e\u3059\u3002<\/p>\n<div>~\/wordpress\/.dockerignore\u3092\u65e5\u672c\u8a9e\u306b\u81ea\u7136\u306a\u8a00\u3044\u65b9\u3067\u8a00\u3044\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/div>\n<pre class=\"post-pre\"><code>.env\r\n.git\r\ndocker-compose.yml\r\n.dockerignore\r\n<\/code><\/pre>\n<p>\u4f5c\u696d\u304c\u7d42\u308f\u3063\u305f\u3089\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3042\u306a\u305f\u306e\u500b\u4eba\u60c5\u5831\u3092\u6307\u5b9a\u3057\u305f\u3089\u3001\u6b21\u306fdocker-compose.yml\u30d5\u30a1\u30a4\u30eb\u3067\u30b5\u30fc\u30d3\u30b9\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d73 \u2014 Docker Compose\u3067\u30b5\u30fc\u30d3\u30b9\u3092\u5b9a\u7fa9\u3059\u308b<\/h2>\n<p>\u3042\u306a\u305f\u306edocker-compose.yml\u30d5\u30a1\u30a4\u30eb\u306b\u306f\u3001\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u305f\u3081\u306e\u30b5\u30fc\u30d3\u30b9\u306e\u5b9a\u7fa9\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002Compose\u306e\u30b5\u30fc\u30d3\u30b9\u306f\u5b9f\u884c\u4e2d\u306e\u30b3\u30f3\u30c6\u30ca\u3067\u3042\u308a\u3001\u30b5\u30fc\u30d3\u30b9\u306e\u5b9a\u7fa9\u306f\u5404\u30b3\u30f3\u30c6\u30ca\u304c\u3069\u306e\u3088\u3046\u306b\u5b9f\u884c\u3055\u308c\u308b\u304b\u306b\u95a2\u3059\u308b\u60c5\u5831\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>Compose\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u8907\u6570\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u7570\u306a\u308b\u30b5\u30fc\u30d3\u30b9\u3092\u5b9a\u7fa9\u3067\u304d\u307e\u3059\u3002Compose\u306b\u3088\u308a\u3001\u3053\u308c\u3089\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u5171\u6709\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3068\u30dc\u30ea\u30e5\u30fc\u30e0\u3067\u30ea\u30f3\u30af\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u73fe\u5728\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b\u306f\u4fbf\u5229\u3067\u3042\u308a\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3001WordPress\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3001Web\u30b5\u30fc\u30d0\u30fc\u306e\u305f\u3081\u306e\u7570\u306a\u308b\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u307e\u305f\u3001Certbot\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3092\u5b9f\u884c\u3059\u308b\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u6210\u3057\u3066\u3001Web\u30b5\u30fc\u30d0\u30fc\u306e\u8a3c\u660e\u66f8\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u306b\u3001docker-compose.yml\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u958b\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> docker-compose.yml<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Compose\u30d5\u30a1\u30a4\u30eb\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3068db\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b5\u30fc\u30d3\u30b9\u3092\u5b9a\u7fa9\u3059\u308b\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\u4ee5\u4e0b\u306e\u6587\u3092\u65e5\u672c\u8a9e\u3067\u81ea\u7136\u306b\u8a00\u3044\u63db\u3048\u3066\u304f\u3060\u3055\u3044\uff08\u4e00\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u7d50\u69cb\u3067\u3059\uff09\uff1a<br \/>\n\u301c\/wordpress\/docker-compose.yml<\/div>\n<pre class=\"post-pre\"><code><span class=\"token key atrule\">version<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">'3'<\/span>\r\n\r\n<span class=\"token key atrule\">services<\/span><span class=\"token punctuation\">:<\/span>\r\n  <span class=\"token key atrule\">db<\/span><span class=\"token punctuation\">:<\/span>\r\n    <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> mysql<span class=\"token punctuation\">:<\/span><span class=\"token number\">8.0<\/span>\r\n    <span class=\"token key atrule\">container_name<\/span><span class=\"token punctuation\">:<\/span> db\r\n    <span class=\"token key atrule\">restart<\/span><span class=\"token punctuation\">:<\/span> unless<span class=\"token punctuation\">-<\/span>stopped\r\n    <span class=\"token key atrule\">env_file<\/span><span class=\"token punctuation\">:<\/span> .env\r\n    <span class=\"token key atrule\">environment<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> MYSQL_DATABASE=wordpress\r\n    <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span> \r\n      <span class=\"token punctuation\">-<\/span> dbdata<span class=\"token punctuation\">:<\/span>\/var\/lib\/mysql\r\n    <span class=\"token key atrule\">command<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">'--default-authentication-plugin=mysql_native_password'<\/span>\r\n    <span class=\"token key atrule\">networks<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> app<span class=\"token punctuation\">-<\/span>network\r\n<\/code><\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b5\u30fc\u30d3\u30b9\u306e\u5b9a\u7fa9\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>image: This tells Compose what image to pull to create the container. You are pinning the mysql:8.0 image here to avoid future conflicts as the mysql:latest image continues to be updated. For more information about version pinning and avoiding dependency conflicts, read the Docker documentation on Dockerfile best practices.<\/li>\n<li>container_name: This specifies a name for the container.<\/li>\n<li>restart: This defines the container restart policy. The default is no, but you have set the container to restart unless it is stopped manually.<\/li>\n<li>env_file: This option tells Compose that you would like to add environment variables from a file called .env, located in your build context. In this case, the build context is your current directory.<\/li>\n<li>environment: This option allows you to add additional environment variables, beyond those defined in your .env file. You will set the MYSQL_DATABASE variable equal to wordpress to provide a name for your application database. Because this is non-sensitive information, you can include it directly in the docker-compose.yml file.<\/li>\n<li>volumes: Here, you\u2019re mounting a named volume called dbdata to the \/var\/lib\/mysql directory on the container. This is the standard data directory for MySQL on most distributions.<\/li>\n<li>command: This option specifies a command to override the default CMD instruction for the image. In this particular case, you will add an option to the Docker image\u2019s standard mysqld command, which starts the MySQL server on the container. This option, &#8211;default-authentication-plugin=mysql_native_password, sets the &#8211;default-authentication-plugin system variable to mysql_native_password, specifying which authentication mechanism should govern new authentication requests to the server. Since PHP and therefore your WordPress image won\u2019t support MySQL\u2019s newer authentication default, you must make this adjustment in order to authenticate your application database user.<\/li>\n<li>networks: This specifies that your application service will join the app-network network, which you will define at the bottom of the file.<\/li>\n<\/ul>\n<p>\u6b21\u306b\u3001db\u30b5\u30fc\u30d3\u30b9\u306e\u5b9a\u7fa9\u306e\u4e0b\u306b\u3001wordpress\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30b5\u30fc\u30d3\u30b9\u5b9a\u7fa9\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\u4ee5\u4e0b\u306f\u3001~\/wordpress\/docker-compose.yml\u3092\u65e5\u672c\u8a9e\u3067\u8868\u73fe\u3057\u305f\u3082\u306e\u3067\u3059\uff081\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u307f\uff09\uff1a<br \/>\n\u300c~ \/wordpress\/docker-compose.yml\u300d<\/div>\n<pre class=\"post-pre\"><code><span class=\"token punctuation\">...<\/span>\r\n  <span class=\"token key atrule\">wordpress<\/span><span class=\"token punctuation\">:<\/span>\r\n    <span class=\"token key atrule\">depends_on<\/span><span class=\"token punctuation\">:<\/span> \r\n      <span class=\"token punctuation\">-<\/span> db\r\n    <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> wordpress<span class=\"token punctuation\">:<\/span>5.1.1<span class=\"token punctuation\">-<\/span>fpm<span class=\"token punctuation\">-<\/span>alpine\r\n    <span class=\"token key atrule\">container_name<\/span><span class=\"token punctuation\">:<\/span> wordpress\r\n    <span class=\"token key atrule\">restart<\/span><span class=\"token punctuation\">:<\/span> unless<span class=\"token punctuation\">-<\/span>stopped\r\n    <span class=\"token key atrule\">env_file<\/span><span class=\"token punctuation\">:<\/span> .env\r\n    <span class=\"token key atrule\">environment<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> WORDPRESS_DB_HOST=db<span class=\"token punctuation\">:<\/span><span class=\"token number\">3306<\/span>\r\n      <span class=\"token punctuation\">-<\/span> WORDPRESS_DB_USER=$MYSQL_USER\r\n      <span class=\"token punctuation\">-<\/span> WORDPRESS_DB_PASSWORD=$MYSQL_PASSWORD\r\n      <span class=\"token punctuation\">-<\/span> WORDPRESS_DB_NAME=wordpress\r\n    <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> wordpress<span class=\"token punctuation\">:<\/span>\/var\/www\/html\r\n    <span class=\"token key atrule\">networks<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> app<span class=\"token punctuation\">-<\/span>network\r\n<\/code><\/pre>\n<p>\u3053\u306e\u30b5\u30fc\u30d3\u30b9\u5b9a\u7fa9\u3067\u306f\u3001\u30b3\u30f3\u30c6\u30ca\u306e\u540d\u524d\u3092\u5b9a\u7fa9\u3057\u3001\u518d\u8d77\u52d5\u30dd\u30ea\u30b7\u30fc\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001db\u30b5\u30fc\u30d3\u30b9\u3068\u540c\u69d8\u306b\u3001\u3053\u306e\u30b3\u30f3\u30c6\u30ca\u306b\u56fa\u6709\u306e\u3044\u304f\u3064\u304b\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>depends_on: This option ensures that your containers will start in order of dependency, with the wordpress container starting after the db container. Your WordPress application relies on the existence of your application database and user, so expressing this order of dependency will enable your application to start properly.<\/li>\n<li>image: For this setup, you are using the 5.1.1-fpm-alpine WordPress image. As discussed in Step 1, using this image ensures that your application will have the php-fpm processor that Nginx requires to handle PHP processing. This is also an alpine image, derived from the Alpine Linux project, which will help keep your overall image size down. For more information about the benefits and drawbacks of using alpine images and whether or not this makes sense for your application, review the full discussion under the Image Variants section of the Docker Hub WordPress image page.<\/li>\n<li>env_file: Again, you specify that you want to pull values from your .env file, since this is where you defined your application database user and password.<\/li>\n<li>environment: Here, you\u2019re using the values you defined in your .env file, but are assigning them to the variable names that the WordPress image expects: WORDPRESS_DB_USER and WORDPRESS_DB_PASSWORD. You\u2019re also defining a WORDPRESS_DB_HOST, which will be the MySQL server running on the db container that\u2019s accessible on MySQL\u2019s default port, 3306. Your WORDPRESS_DB_NAME will be the same value you specified in the MySQL service definition for your MYSQL_DATABASE: wordpress.<\/li>\n<li>volumes: You are mounting a named volume called wordpress to the \/var\/www\/html mountpoint created by the WordPress image. Using a named volume in this way will allow you to share your application code with other containers.<\/li>\n<li>networks: You\u2019re also adding the wordpress container to the app-network network.<\/li>\n<\/ul>\n<p>\u6b21\u306b\u3001WordPress\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d3\u30b9\u306e\u5b9a\u7fa9\u306e\u4e0b\u306b\u3001Web\u30b5\u30fc\u30d0\u30fcNginx\u30b5\u30fc\u30d3\u30b9\u306e\u6b21\u306e\u5b9a\u7fa9\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\u4ee5\u4e0b\u306e\u5185\u5bb9\u3092\u65e5\u672c\u8a9e\u3067\u81ea\u7136\u306b\u8a00\u3044\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002\u30aa\u30d7\u30b7\u30e7\u30f3\u306f1\u3064\u3060\u3051\u5fc5\u8981\u3067\u3059\uff1a<br \/>\n~\/wordpress\/docker-compose.yml\u30c9\u30c3\u30ab\u30fc\u30b3\u30f3\u30dd\u30fc\u30ba\u306e\u30d5\u30a1\u30a4\u30eb\u3001~\/wordpress\/docker-compose.yml \u306e\u5185\u5bb9\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div>\n<pre class=\"post-pre\"><code><span class=\"token punctuation\">...<\/span>\r\n  <span class=\"token key atrule\">webserver<\/span><span class=\"token punctuation\">:<\/span>\r\n    <span class=\"token key atrule\">depends_on<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> wordpress\r\n    <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> nginx<span class=\"token punctuation\">:<\/span>1.15.12<span class=\"token punctuation\">-<\/span>alpine\r\n    <span class=\"token key atrule\">container_name<\/span><span class=\"token punctuation\">:<\/span> webserver\r\n    <span class=\"token key atrule\">restart<\/span><span class=\"token punctuation\">:<\/span> unless<span class=\"token punctuation\">-<\/span>stopped\r\n    <span class=\"token key atrule\">ports<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> <span class=\"token string\">\"80:80\"<\/span>\r\n    <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> wordpress<span class=\"token punctuation\">:<\/span>\/var\/www\/html\r\n      <span class=\"token punctuation\">-<\/span> .\/nginx<span class=\"token punctuation\">-<\/span>conf<span class=\"token punctuation\">:<\/span>\/etc\/nginx\/conf.d\r\n      <span class=\"token punctuation\">-<\/span> certbot<span class=\"token punctuation\">-<\/span>etc<span class=\"token punctuation\">:<\/span>\/etc\/letsencrypt\r\n    <span class=\"token key atrule\">networks<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> app<span class=\"token punctuation\">-<\/span>network\r\n<\/code><\/pre>\n<p>\u3053\u3053\u3067\u306f\u3001\u30b3\u30f3\u30c6\u30ca\u306b\u540d\u524d\u3092\u4ed8\u3051\u3066\u3001\u958b\u59cb\u306e\u9806\u5e8f\u3067WordPress\u30b3\u30f3\u30c6\u30ca\u306b\u4f9d\u5b58\u3055\u305b\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001\u30a2\u30eb\u30d1\u30a4\u30f3\u30a4\u30e1\u30fc\u30b8\uff081.15.12-alpine Nginx\u30a4\u30e1\u30fc\u30b8\uff09\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30b5\u30fc\u30d3\u30b9\u306e\u5b9a\u7fa9\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3082\u542b\u307e\u308c\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>ports: This exposes port 80 to enable the configuration options you defined in your nginx.conf file in Step 1.<\/li>\n<li>volumes: Here, you are defining a combination of named volumes and bind mounts:wordpress:\/var\/www\/html: This will mount your WordPress application code to the \/var\/www\/html directory, the directory you set as the root in your Nginx server block.<br \/>\n.\/nginx-conf:\/etc\/nginx\/conf.d: This will bind mount the Nginx configuration directory on the host to the relevant directory on the container, ensuring that any changes you make to files on the host will be reflected in the container.<br \/>\ncertbot-etc:\/etc\/letsencrypt: This will mount the relevant Let\u2019s Encrypt certificates and keys for your domain to the appropriate directory on the container.<\/li>\n<\/ul>\n<p>\u3042\u306a\u305f\u306f\u3053\u306e\u30b3\u30f3\u30c6\u30ca\u3082app-network\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u6700\u5f8c\u306b\u3001\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u306e\u5b9a\u7fa9\u306e\u4e0b\u306b\u3001certbot\u30b5\u30fc\u30d3\u30b9\u306e\u5b9a\u7fa9\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u3053\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3068\u30c9\u30e1\u30a4\u30f3\u540d\u306f\u3001\u81ea\u5206\u306e\u60c5\u5831\u306b\u7f6e\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\u4ee5\u4e0b\u306f\u3001~\/wordpress\/docker-compose.yml\u306e\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u306e\u8868\u73fe\u3067\u3059\uff08\uff11\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u307f\uff09:<br \/>\n\u300c~\/wordpress\/docker-compose.yml\u300d\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/div>\n<pre class=\"post-pre\"><code>  <span class=\"token key atrule\">certbot<\/span><span class=\"token punctuation\">:<\/span>\r\n    <span class=\"token key atrule\">depends_on<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> webserver\r\n    <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> certbot\/certbot\r\n    <span class=\"token key atrule\">container_name<\/span><span class=\"token punctuation\">:<\/span> certbot\r\n    <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> certbot<span class=\"token punctuation\">-<\/span>etc<span class=\"token punctuation\">:<\/span>\/etc\/letsencrypt\r\n      <span class=\"token punctuation\">-<\/span> wordpress<span class=\"token punctuation\">:<\/span>\/var\/www\/html\r\n    <span class=\"token key atrule\">command<\/span><span class=\"token punctuation\">:<\/span> certonly <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>webroot <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>webroot<span class=\"token punctuation\">-<\/span>path=\/var\/www\/html <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>email <mark>sammy@your_domain<\/mark> <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>agree<span class=\"token punctuation\">-<\/span>tos <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>no<span class=\"token punctuation\">-<\/span>eff<span class=\"token punctuation\">-<\/span>email <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>staging <span class=\"token punctuation\">-<\/span>d <mark>your_domain<\/mark> <span class=\"token punctuation\">-<\/span>d www.<mark>your_domain<\/mark>\r\n<\/code><\/pre>\n<p>\u3053\u306e\u5b9a\u7fa9\u306f\u3001Docker Hub\u304b\u3089certbot\/certbot\u30a4\u30e1\u30fc\u30b8\u3092\u53d6\u5f97\u3059\u308b\u3088\u3046Compose\u306b\u6307\u793a\u3057\u307e\u3059\u3002\u307e\u305f\u3001certbot-etc\u306e\u30c9\u30e1\u30a4\u30f3\u8a3c\u660e\u66f8\u3068\u9375\u3001\u304a\u3088\u3073wordpress\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u306a\u3069\u306e\u30ea\u30bd\u30fc\u30b9\u3092Nginx\u30b3\u30f3\u30c6\u30ca\u3068\u5171\u6709\u3059\u308b\u305f\u3081\u306b\u3001\u540d\u524d\u4ed8\u304d\u30dc\u30ea\u30e5\u30fc\u30e0\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u518d\u3073\u3001web\u30b5\u30fc\u30d0\u30fc\u30b5\u30fc\u30d3\u30b9\u304c\u5b9f\u884c\u3055\u308c\u3066\u304b\u3089certbot\u30b3\u30f3\u30c6\u30ca\u304c\u958b\u59cb\u3055\u308c\u308b\u3088\u3046\u306bdepends_on\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u30b3\u30f3\u30c6\u30ca\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306ecertbot\u30b3\u30de\u30f3\u30c9\u3067\u5b9f\u884c\u3059\u308b\u30b5\u30d6\u30b3\u30de\u30f3\u30c9\u3092\u6307\u5b9a\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3082\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002certonly\u30b5\u30d6\u30b3\u30de\u30f3\u30c9\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u3066\u8a3c\u660e\u66f8\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>&#8211;webroot: This tells Certbot to use the webroot plugin to place files in the webroot folder for authentication. This plugin depends on the HTTP-01 validation method, which uses an HTTP request to prove that Certbot can access resources from a server that responds to a given domain name.<\/li>\n<li>&#8211;webroot-path: This specifies the path of the webroot directory.<\/li>\n<li>&#8211;email: Your preferred email for registration and recovery.<\/li>\n<li>&#8211;agree-tos: This specifies that you agree to ACME\u2019s Subscriber Agreement.<\/li>\n<li>&#8211;no-eff-email: This tells Certbot that you do not wish to share your email with the Electronic Frontier Foundation (EFF). Feel free to omit this if you would prefer.<\/li>\n<li>&#8211;staging: This tells Certbot that you would like to use Let\u2019s Encrypt\u2019s staging environment to obtain test certificates. Using this option allows you to test your configuration options and avoid possible domain request limits. For more information about these limits, please read Let\u2019s Encrypt\u2019s rate limits documentation.<\/li>\n<li>-d: This allows you to specify domain names you would like to apply to your request. In this case, you\u2019ve included your_domain and www.your_domain. Be sure to replace these with your own domain.<\/li>\n<\/ul>\n<p>certbot\u30b5\u30fc\u30d3\u30b9\u306e\u5b9a\u7fa9\u306e\u4e0b\u306b\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3068\u30dc\u30ea\u30e5\u30fc\u30e0\u306e\u5b9a\u7fa9\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\n<p>~\/wordpress\/docker-compose.yml\u3092\u65e5\u672c\u8a9e\u3067\u8868\u73fe\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff1a<\/p>\n<p>\u300c~\/wordpress\/docker-compose.yml\u300d<\/p>\n<\/div>\n<pre class=\"post-pre\"><code><span class=\"token punctuation\">...<\/span>\r\n<span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span>\r\n  <span class=\"token key atrule\">certbot-etc<\/span><span class=\"token punctuation\">:<\/span>\r\n  <span class=\"token key atrule\">wordpress<\/span><span class=\"token punctuation\">:<\/span>\r\n  <span class=\"token key atrule\">dbdata<\/span><span class=\"token punctuation\">:<\/span>\r\n\r\n<span class=\"token key atrule\">networks<\/span><span class=\"token punctuation\">:<\/span>\r\n  <span class=\"token key atrule\">app-network<\/span><span class=\"token punctuation\">:<\/span>\r\n    <span class=\"token key atrule\">driver<\/span><span class=\"token punctuation\">:<\/span> bridge  \r\n<\/code><\/pre>\n<p>\u30c8\u30c3\u30d7\u30ec\u30d9\u30eb\u306evolumes\u30ad\u30fc\u306f\u3001volumes certbot-etc\u3001wordpress\u3001\u305d\u3057\u3066dbdata\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u3002Docker\u304c\u30dc\u30ea\u30e5\u30fc\u30e0\u3092\u4f5c\u6210\u3059\u308b\u3068\u304d\u3001\u30dc\u30ea\u30e5\u30fc\u30e0\u306e\u5185\u5bb9\u306fDocker\u304c\u7ba1\u7406\u3059\u308b\u30db\u30b9\u30c8\u306e\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3001\/var\/lib\/docker\/volumes\/\u306b\u4fdd\u5b58\u3055\u308c\u307e\u3059\u3002\u305d\u308c\u305e\u308c\u306e\u30dc\u30ea\u30e5\u30fc\u30e0\u306e\u5185\u5bb9\u306f\u3001\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304b\u3089\u30dc\u30ea\u30e5\u30fc\u30e0\u3092\u4f7f\u7528\u3059\u308b\u30b3\u30f3\u30c6\u30ca\u306b\u30de\u30a6\u30f3\u30c8\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u65b9\u6cd5\u3067\u3001\u30b3\u30f3\u30c6\u30ca\u9593\u3067\u30b3\u30fc\u30c9\u3068\u30c7\u30fc\u30bf\u3092\u5171\u6709\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u306e\u30d6\u30ea\u30c3\u30b8\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u300capp-network\u300d\u306f\u3001Docker\u30c7\u30fc\u30e2\u30f3\u30db\u30b9\u30c8\u4e0a\u306b\u3042\u308b\u30b3\u30f3\u30c6\u30ca\u540c\u58eb\u306e\u901a\u4fe1\u3092\u53ef\u80fd\u306b\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5185\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3068\u901a\u4fe1\u304c\u52b9\u7387\u5316\u3055\u308c\u3001\u540c\u3058\u30d6\u30ea\u30c3\u30b8\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u4e0a\u306e\u30b3\u30f3\u30c6\u30ca\u9593\u3067\u5168\u30dd\u30fc\u30c8\u304c\u958b\u304b\u308c\u307e\u3059\u304c\u3001\u5916\u90e8\u306b\u306f\u4e00\u5207\u306e\u30dd\u30fc\u30c8\u304c\u516c\u958b\u3055\u308c\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001db\u3001wordpress\u3001webserver\u306e\u30b3\u30f3\u30c6\u30ca\u306f\u4e92\u3044\u306b\u901a\u4fe1\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3078\u306e\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u30a2\u30af\u30bb\u30b9\u306b\u306f\u30dd\u30fc\u30c880\u306e\u516c\u958b\u306e\u307f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306f\u3001\u5b8c\u5168\u306adocker-compose.yml\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<\/p>\n<div>\u4ee5\u4e0b\u306fdocker-compose.yml\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<\/div>\n<pre class=\"post-pre\"><code><span class=\"token key atrule\">version<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">'3'<\/span>\r\n\r\n<span class=\"token key atrule\">services<\/span><span class=\"token punctuation\">:<\/span>\r\n  <span class=\"token key atrule\">db<\/span><span class=\"token punctuation\">:<\/span>\r\n    <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> mysql<span class=\"token punctuation\">:<\/span><span class=\"token number\">8.0<\/span>\r\n    <span class=\"token key atrule\">container_name<\/span><span class=\"token punctuation\">:<\/span> db\r\n    <span class=\"token key atrule\">restart<\/span><span class=\"token punctuation\">:<\/span> unless<span class=\"token punctuation\">-<\/span>stopped\r\n    <span class=\"token key atrule\">env_file<\/span><span class=\"token punctuation\">:<\/span> .env\r\n    <span class=\"token key atrule\">environment<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> MYSQL_DATABASE=wordpress\r\n    <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span> \r\n      <span class=\"token punctuation\">-<\/span> dbdata<span class=\"token punctuation\">:<\/span>\/var\/lib\/mysql\r\n    <span class=\"token key atrule\">command<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">'--default-authentication-plugin=mysql_native_password'<\/span>\r\n    <span class=\"token key atrule\">networks<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> app<span class=\"token punctuation\">-<\/span>network\r\n\r\n  <span class=\"token key atrule\">wordpress<\/span><span class=\"token punctuation\">:<\/span>\r\n    <span class=\"token key atrule\">depends_on<\/span><span class=\"token punctuation\">:<\/span> \r\n      <span class=\"token punctuation\">-<\/span> db\r\n    <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> wordpress<span class=\"token punctuation\">:<\/span>5.1.1<span class=\"token punctuation\">-<\/span>fpm<span class=\"token punctuation\">-<\/span>alpine\r\n    <span class=\"token key atrule\">container_name<\/span><span class=\"token punctuation\">:<\/span> wordpress\r\n    <span class=\"token key atrule\">restart<\/span><span class=\"token punctuation\">:<\/span> unless<span class=\"token punctuation\">-<\/span>stopped\r\n    <span class=\"token key atrule\">env_file<\/span><span class=\"token punctuation\">:<\/span> .env\r\n    <span class=\"token key atrule\">environment<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> WORDPRESS_DB_HOST=db<span class=\"token punctuation\">:<\/span><span class=\"token number\">3306<\/span>\r\n      <span class=\"token punctuation\">-<\/span> WORDPRESS_DB_USER=$MYSQL_USER\r\n      <span class=\"token punctuation\">-<\/span> WORDPRESS_DB_PASSWORD=$MYSQL_PASSWORD\r\n      <span class=\"token punctuation\">-<\/span> WORDPRESS_DB_NAME=wordpress\r\n    <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> wordpress<span class=\"token punctuation\">:<\/span>\/var\/www\/html\r\n    <span class=\"token key atrule\">networks<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> app<span class=\"token punctuation\">-<\/span>network\r\n\r\n  <span class=\"token key atrule\">webserver<\/span><span class=\"token punctuation\">:<\/span>\r\n    <span class=\"token key atrule\">depends_on<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> wordpress\r\n    <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> nginx<span class=\"token punctuation\">:<\/span>1.15.12<span class=\"token punctuation\">-<\/span>alpine\r\n    <span class=\"token key atrule\">container_name<\/span><span class=\"token punctuation\">:<\/span> webserver\r\n    <span class=\"token key atrule\">restart<\/span><span class=\"token punctuation\">:<\/span> unless<span class=\"token punctuation\">-<\/span>stopped\r\n    <span class=\"token key atrule\">ports<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> <span class=\"token string\">\"80:80\"<\/span>\r\n    <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> wordpress<span class=\"token punctuation\">:<\/span>\/var\/www\/html\r\n      <span class=\"token punctuation\">-<\/span> .\/nginx<span class=\"token punctuation\">-<\/span>conf<span class=\"token punctuation\">:<\/span>\/etc\/nginx\/conf.d\r\n      <span class=\"token punctuation\">-<\/span> certbot<span class=\"token punctuation\">-<\/span>etc<span class=\"token punctuation\">:<\/span>\/etc\/letsencrypt\r\n    <span class=\"token key atrule\">networks<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> app<span class=\"token punctuation\">-<\/span>network\r\n\r\n  <span class=\"token key atrule\">certbot<\/span><span class=\"token punctuation\">:<\/span>\r\n    <span class=\"token key atrule\">depends_on<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> webserver\r\n    <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> certbot\/certbot\r\n    <span class=\"token key atrule\">container_name<\/span><span class=\"token punctuation\">:<\/span> certbot\r\n    <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> certbot<span class=\"token punctuation\">-<\/span>etc<span class=\"token punctuation\">:<\/span>\/etc\/letsencrypt\r\n      <span class=\"token punctuation\">-<\/span> wordpress<span class=\"token punctuation\">:<\/span>\/var\/www\/html\r\n    <span class=\"token key atrule\">command<\/span><span class=\"token punctuation\">:<\/span> certonly <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>webroot <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>webroot<span class=\"token punctuation\">-<\/span>path=\/var\/www\/html <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>email <mark>sammy@your_domain<\/mark> <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>agree<span class=\"token punctuation\">-<\/span>tos <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>no<span class=\"token punctuation\">-<\/span>eff<span class=\"token punctuation\">-<\/span>email <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>staging <span class=\"token punctuation\">-<\/span>d <mark>your_domain<\/mark> <span class=\"token punctuation\">-<\/span>d www.<mark>your_domain<\/mark>\r\n\r\n<span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span>\r\n  <span class=\"token key atrule\">certbot-etc<\/span><span class=\"token punctuation\">:<\/span>\r\n  <span class=\"token key atrule\">wordpress<\/span><span class=\"token punctuation\">:<\/span>\r\n  <span class=\"token key atrule\">dbdata<\/span><span class=\"token punctuation\">:<\/span>\r\n\r\n<span class=\"token key atrule\">networks<\/span><span class=\"token punctuation\">:<\/span>\r\n  <span class=\"token key atrule\">app-network<\/span><span class=\"token punctuation\">:<\/span>\r\n    <span class=\"token key atrule\">driver<\/span><span class=\"token punctuation\">:<\/span> bridge  \r\n<\/code><\/pre>\n<p>\u7de8\u96c6\u304c\u7d42\u308f\u3063\u305f\u3089\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3042\u306a\u305f\u306e\u30b5\u30fc\u30d3\u30b9\u306e\u5b9a\u7fa9\u304c\u6574\u3063\u305f\u3089\u3001\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3057\u3066\u8a3c\u660e\u66f8\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u30c6\u30b9\u30c8\u3059\u308b\u6e96\u5099\u304c\u6574\u3044\u307e\u3057\u305f\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d74 &#8211; SSL\u8a3c\u660e\u66f8\u3068\u30af\u30ec\u30c7\u30f3\u30b7\u30e3\u30eb\u306e\u53d6\u5f97<\/h2>\n<p>docker-compose up\u30b3\u30de\u30f3\u30c9\u3067\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f\u6307\u5b9a\u3057\u305f\u9806\u5e8f\u3067\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u6210\u3057\u3001\u5b9f\u884c\u3057\u307e\u3059\u3002-d\u30d5\u30e9\u30b0\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3001db\u3001wordpress\u3001webserver\u30b3\u30f3\u30c6\u30ca\u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">docker-compose<\/span> up <span class=\"token parameter variable\">-d<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u306b\u3088\u308a\u3001\u304a\u5ba2\u69d8\u306e\u30b5\u30fc\u30d3\u30b9\u304c\u4f5c\u6210\u3055\u308c\u305f\u3053\u3068\u304c\u78ba\u8a8d\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Creating db &#8230; done Creating wordpress &#8230; done Creating webserver &#8230; done Creating certbot &#8230; done<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>docker-compose ps\u3092\u4f7f\u7528\u3057\u3066\u3001\u30b5\u30fc\u30d3\u30b9\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">docker-compose<\/span> <span class=\"token function\">ps<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u5b8c\u4e86\u3057\u305f\u3089\u3001DB\u3001WordPress\u3001\u304a\u3088\u3073Web\u30b5\u30fc\u30d0\u30fc\u30b5\u30fc\u30d3\u30b9\u304c\u30a2\u30c3\u30d7\u3057\u3001certbot\u30b3\u30f3\u30c6\u30ca\u306f0\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u30e1\u30c3\u30bb\u30fc\u30b8\u3067\u7d42\u4e86\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Name Command State Ports &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- certbot certbot certonly &#8211;webroot &#8230; Exit 0 db docker-entrypoint.sh &#8211;def &#8230; Up 3306\/tcp, 33060\/tcp webserver nginx -g daemon off; Up 0.0.0.0:80-&gt;80\/tcp wordpress docker-entrypoint.sh php-fpm Up 9000\/tcp<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3001WordPress\u3001\u307e\u305f\u306fWeb\u30b5\u30fc\u30d0\u30fc\u30b5\u30fc\u30d3\u30b9\u306e\u300cState\u300d\u5217\u4ee5\u5916\u3067\u300cUp\u300d\u4ee5\u5916\u306e\u5024\u3001\u307e\u305f\u306fcertbot\u30b3\u30f3\u30c6\u30ca\u306e\u7d42\u4e86\u30b9\u30c6\u30fc\u30bf\u30b9\u304c0\u4ee5\u5916\u306e\u5834\u5408\u3001docker-compose logs\u30b3\u30de\u30f3\u30c9\u3067\u30b5\u30fc\u30d3\u30b9\u30ed\u30b0\u3092\u78ba\u8a8d\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">docker-compose<\/span> logs <mark>service_name<\/mark><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>docker-compose exec\u3067\u3001\u8a3c\u660e\u66f8\u304c\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u30b3\u30f3\u30c6\u30ca\u306b\u30de\u30a6\u30f3\u30c8\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">docker-compose<\/span> <span class=\"token builtin class-name\">exec<\/span> webserver <span class=\"token function\">ls<\/span> <span class=\"token parameter variable\">-la<\/span> \/etc\/letsencrypt\/live<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u8a3c\u660e\u66f8\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u6210\u529f\u3057\u305f\u3089\u3001\u4ee5\u4e0b\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>total 16 drwx&#8212;&#8212; 3 root root 4096 May 10 15:45 . drwxr-xr-x 9 root root 4096 May 10 15:45 .. -rw-r&#8211;r&#8211; 1 root root 740 May 10 15:45 README drwxr-xr-x 2 root root 4096 May 10 15:45 <mark>your_domain<\/mark><\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3042\u306a\u305f\u304c\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u6210\u529f\u3059\u308b\u3053\u3068\u3092\u77e5\u3063\u305f\u306e\u3067\u3001certbot\u306e\u30b5\u30fc\u30d3\u30b9\u5b9a\u7fa9\u3092\u7de8\u96c6\u3057\u3066\u3001&#8211;staging\u30d5\u30e9\u30b0\u3092\u524a\u9664\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>docker-compose.yml\u3092\u958b\u304f<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> docker-compose.yml<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u304b\u3089certbot\u306e\u30b5\u30fc\u30d3\u30b9\u5b9a\u7fa9\u90e8\u5206\u3092\u898b\u3064\u3051\u3001\u30b3\u30de\u30f3\u30c9\u30aa\u30d7\u30b7\u30e7\u30f3\u306e&#8211;staging\u30d5\u30e9\u30b0\u3092&#8211;force-renewal\u30d5\u30e9\u30b0\u306b\u7f6e\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002&#8211;force-renewal\u30d5\u30e9\u30b0\u306f\u3001\u65e2\u5b58\u306e\u8a3c\u660e\u66f8\u3068\u540c\u3058\u30c9\u30e1\u30a4\u30f3\u3067\u65b0\u3057\u3044\u8a3c\u660e\u66f8\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3059\u308b\u3053\u3068\u3092Certbot\u306b\u4f1d\u3048\u307e\u3059\u3002\u4ee5\u4e0b\u306f\u66f4\u65b0\u3055\u308c\u305f\u30d5\u30e9\u30b0\u3092\u542b\u3093\u3060certbot\u306e\u30b5\u30fc\u30d3\u30b9\u5b9a\u7fa9\u3067\u3059\u3002<\/p>\n<div>\n<p>~\/wordpress\/docker-compose.yml\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<p>&#8211; ~\/wordpress\/docker-compose.yml\u30d5\u30a1\u30a4\u30eb<\/p>\n<\/div>\n<pre class=\"post-pre\"><code><span class=\"token punctuation\">...<\/span>\r\n  <span class=\"token key atrule\">certbot<\/span><span class=\"token punctuation\">:<\/span>\r\n    <span class=\"token key atrule\">depends_on<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> webserver\r\n    <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> certbot\/certbot\r\n    <span class=\"token key atrule\">container_name<\/span><span class=\"token punctuation\">:<\/span> certbot\r\n    <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> certbot<span class=\"token punctuation\">-<\/span>etc<span class=\"token punctuation\">:<\/span>\/etc\/letsencrypt\r\n      <span class=\"token punctuation\">-<\/span> certbot<span class=\"token punctuation\">-<\/span>var<span class=\"token punctuation\">:<\/span>\/var\/lib\/letsencrypt\r\n      <span class=\"token punctuation\">-<\/span> wordpress<span class=\"token punctuation\">:<\/span>\/var\/www\/html\r\n    <span class=\"token key atrule\">command<\/span><span class=\"token punctuation\">:<\/span> certonly <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>webroot <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>webroot<span class=\"token punctuation\">-<\/span>path=\/var\/www\/html <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>email <mark>sammy@your_domain<\/mark> <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>agree<span class=\"token punctuation\">-<\/span>tos <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>no<span class=\"token punctuation\">-<\/span>eff<span class=\"token punctuation\">-<\/span>email <mark><span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>force<span class=\"token punctuation\">-<\/span>renewal<\/mark> <span class=\"token punctuation\">-<\/span>d <mark>your_domain<\/mark> <span class=\"token punctuation\">-<\/span>d www.<mark>your_domain<\/mark>\r\n<span class=\"token punctuation\">...<\/span>\r\n<\/code><\/pre>\n<p>certbot\u30b3\u30f3\u30c6\u30ca\u3092\u518d\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u3001\u73fe\u5728docker-compose up\u3092\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u3001&#8211;no-deps\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u542b\u3081\u308b\u3053\u3068\u3067\u3001Compose\u306b\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u30b5\u30fc\u30d3\u30b9\u306e\u8d77\u52d5\u3092\u30b9\u30ad\u30c3\u30d7\u3059\u308b\u3088\u3046\u306b\u6307\u793a\u3057\u307e\u3059\u3002\u306a\u305c\u306a\u3089\u3001\u65e2\u306b\u5b9f\u884c\u4e2d\u3060\u304b\u3089\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">docker-compose<\/span> up &#8211;force-recreate &#8211;no-deps certbot<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u306f\u3001\u8a3c\u660e\u66f8\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u6210\u529f\u3057\u305f\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Recreating certbot &#8230; done Attaching to certbot certbot | Saving debug log to \/var\/log\/letsencrypt\/letsencrypt.log certbot | Plugins selected: Authenticator webroot, Installer None certbot | Renewing an existing certificate certbot | Performing the following challenges: certbot | http-01 challenge for <mark>your_domain<\/mark> certbot | http-01 challenge for www.<mark>your_domain<\/mark> certbot | Using the webroot path \/var\/www\/html for all unmatched domains. certbot | Waiting for verification&#8230; certbot | Cleaning up challenges certbot | IMPORTANT NOTES: certbot | &#8211; Congratulations! Your certificate and chain have been saved at: certbot | \/etc\/letsencrypt\/live\/<mark>your_domain<\/mark>\/fullchain.pem certbot | Your key file has been saved at: certbot | \/etc\/letsencrypt\/live\/<mark>your_domain<\/mark>\/privkey.pem certbot | Your cert will expire on 2019-08-08. To obtain a new or tweaked certbot | version of this certificate in the future, simply run certbot certbot | again. To non-interactively renew *all* of your certificates, run certbot | &#8220;certbot renew&#8221; certbot | &#8211; Your account credentials have been saved in your Certbot certbot | configuration directory at \/etc\/letsencrypt. You should make a certbot | secure backup of this folder now. This configuration directory will certbot | also contain certificates and private keys obtained by Certbot so certbot | making regular backups of this folder is ideal. certbot | &#8211; If you like Certbot, please consider supporting our work by: certbot | certbot | Donating to ISRG \/ Let&#8217;s Encrypt: https:\/\/letsencrypt.org\/donate certbot | Donating to EFF: https:\/\/eff.org\/donate-le certbot | certbot exited with code 0<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u8a3c\u660e\u66f8\u304c\u7528\u610f\u3067\u304d\u305f\u3089\u3001Nginx\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3057\u3066SSL\u3092\u542b\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d75 &#8211; \u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a\u3068\u30b5\u30fc\u30d3\u30b9\u5b9a\u7fa9\u306e\u5909\u66f4<\/h2>\n<p>Nginx\u306e\u8a2d\u5b9a\u3067SSL\u3092\u6709\u52b9\u306b\u3059\u308b\u306b\u306f\u3001HTTP\u304b\u3089HTTPS\u3078\u306e\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3092\u8ffd\u52a0\u3057\u3001SSL\u8a3c\u660e\u66f8\u3068\u30ad\u30fc\u306e\u5834\u6240\u3092\u6307\u5b9a\u3057\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u30d8\u30c3\u30c0\u30fc\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3089\u306e\u8ffd\u52a0\u6a5f\u80fd\u3092\u542b\u3081\u3066\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u518d\u4f5c\u6210\u3059\u308b\u4e88\u5b9a\u3067\u3059\u306e\u3067\u3001\u4eca\u3059\u3050\u505c\u6b62\u3057\u3066\u3044\u305f\u3060\u3044\u3066\u69cb\u3044\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">docker-compose<\/span> stop webserver<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u5909\u66f4\u3059\u308b\u524d\u306b\u3001curl\u3092\u4f7f\u7528\u3057\u3066Certbot\u304b\u3089\u63a8\u5968\u3055\u308c\u308bNginx\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-sSLo<\/span> nginx-conf\/options-ssl-nginx.conf https:\/\/raw.githubusercontent.com\/certbot\/certbot\/master\/certbot-nginx\/certbot_nginx\/_internal\/tls_configs\/options-ssl-nginx.conf<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f\u3001nginx-conf\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u3042\u308boptions-ssl-nginx.conf\u3068\u3044\u3046\u540d\u524d\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u3053\u308c\u3089\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306b\u3001\u524d\u306b\u4f5c\u6210\u3057\u305fNginx\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">rm<\/span> nginx-conf\/nginx.conf<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u306e\u5225\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u3001\u958b\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> nginx-conf\/nginx.conf<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3057\u3066\u3001HTTP\u304b\u3089HTTPS\u3078\u306e\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3084SSL\u306e\u8cc7\u683c\u60c5\u5831\u3001\u30d7\u30ed\u30c8\u30b3\u30eb\u3001\u304a\u3088\u3073\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30d8\u30c3\u30c0\u30fc\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002your_domain\u3092\u81ea\u5206\u306e\u30c9\u30e1\u30a4\u30f3\u306b\u7f6e\u304d\u63db\u3048\u308b\u3053\u3068\u3092\u5fd8\u308c\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\n<p>~\/wordpress\/nginx-conf\/nginx.conf \u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u30021\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u307f\u3067\u5927\u4e08\u592b\u3067\u3059\u3002<\/p>\n<p>~\/wordpress\/nginx-conf\/nginx.conf \u3092\u4ed6\u306e\u8a00\u3044\u65b9\u306b\u3059\u308b\u3068\u3001 \u300c\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306ewordpress\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u4e2d\u306enginx-conf\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u3042\u308bnginx.conf\u30d5\u30a1\u30a4\u30eb\u300d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<\/div>\n<pre class=\"post-pre\"><code>server {\r\n        listen 80;\r\n        listen [::]:80;\r\n\r\n        server_name <mark>your_domain<\/mark> www.<mark>your_domain<\/mark>;\r\n\r\n        location ~ \/.well-known\/acme-challenge {\r\n                allow all;\r\n                root \/var\/www\/html;\r\n        }\r\n\r\n        location \/ {\r\n                rewrite ^ https:\/\/$host$request_uri? permanent;\r\n        }\r\n}\r\n\r\nserver {\r\n        listen 443 ssl http2;\r\n        listen [::]:443 ssl http2;\r\n        server_name <mark>your_domain<\/mark> www.<mark>your_domain<\/mark>;\r\n\r\n        index index.php index.html index.htm;\r\n\r\n        root \/var\/www\/html;\r\n\r\n        server_tokens off;\r\n\r\n        ssl_certificate \/etc\/letsencrypt\/live\/<mark>your_domain<\/mark>\/fullchain.pem;\r\n        ssl_certificate_key \/etc\/letsencrypt\/live\/<mark>your_domain<\/mark>\/privkey.pem;\r\n\r\n        include \/etc\/nginx\/conf.d\/options-ssl-nginx.conf;\r\n\r\n        add_header X-Frame-Options \"SAMEORIGIN\" always;\r\n        add_header X-XSS-Protection \"1; mode=block\" always;\r\n        add_header X-Content-Type-Options \"nosniff\" always;\r\n        add_header Referrer-Policy \"no-referrer-when-downgrade\" always;\r\n        add_header Content-Security-Policy \"default-src * data: 'unsafe-eval' 'unsafe-inline'\" always;\r\n        # add_header Strict-Transport-Security \"max-age=31536000; includeSubDomains; preload\" always;\r\n        # enable strict transport security only if you understand the implications\r\n\r\n        location \/ {\r\n                try_files $uri $uri\/ \/index.php$is_args$args;\r\n        }\r\n\r\n        location ~ \\.php$ {\r\n                try_files $uri =404;\r\n                fastcgi_split_path_info ^(.+\\.php)(\/.+)$;\r\n                fastcgi_pass wordpress:9000;\r\n                fastcgi_index index.php;\r\n                include fastcgi_params;\r\n                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n                fastcgi_param PATH_INFO $fastcgi_path_info;\r\n        }\r\n\r\n        location ~ \/\\.ht {\r\n                deny all;\r\n        }\r\n        \r\n        location = \/favicon.ico { \r\n                log_not_found off; access_log off; \r\n        }\r\n        location = \/robots.txt { \r\n                log_not_found off; access_log off; allow all; \r\n        }\r\n        location ~* \\.(css|gif|ico|jpeg|jpg|js|png)$ {\r\n                expires max;\r\n                log_not_found off;\r\n        }\r\n}\r\n<\/code><\/pre>\n<p>HTTP\u30b5\u30fc\u30d0\u30fc\u30d6\u30ed\u30c3\u30af\u306f\u3001Certbot\u306e\u66f4\u65b0\u30ea\u30af\u30a8\u30b9\u30c8\u3092.well-known\/acme-challenge\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002\u307e\u305f\u3001HTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304b\u3089HTTPS\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\u30ea\u30e9\u30a4\u30c8\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3082\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>HTTPS\u30b5\u30fc\u30d0\u30fc\u30d6\u30ed\u30c3\u30af\u306f\u3001SSL\u3068HTTP\/2\u3092\u6709\u52b9\u306b\u3057\u307e\u3059\u3002HTTP\/2\u304cHTTP\u30d7\u30ed\u30c8\u30b3\u30eb\u306b\u3069\u306e\u3088\u3046\u306b\u9032\u5316\u3057\u3066\u3044\u308b\u304b\u3001\u304a\u3088\u3073\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u304a\u3051\u308b\u5229\u70b9\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u77e5\u308a\u305f\u3044\u5834\u5408\u306f\u3001\u300cUbuntu 18.04\u3067\u306eNginx\u306eHTTP\/2\u30b5\u30dd\u30fc\u30c8\u306e\u8a2d\u5b9a\u65b9\u6cd5\u300d\u306e\u30a4\u30f3\u30c8\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u3092\u304a\u8aad\u307f\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3053\u306e\u30d6\u30ed\u30c3\u30af\u306b\u306f\u3001SSL\u8a3c\u660e\u66f8\u3068\u30ad\u30fc\u306e\u5834\u6240\u304c\u542b\u307e\u308c\u3066\u304a\u308a\u3001nginx-conf\/options-ssl-nginx.conf\u306b\u4fdd\u5b58\u3057\u305f\u63a8\u5968\u306eCertbot\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30d1\u30e9\u30e1\u30fc\u30bf\u3082\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3055\u3089\u306b\u3001SSL Labs\u3084Security Headers\u306e\u30c6\u30b9\u30c8\u30b5\u30a4\u30c8\u306a\u3069\u3067A\u306e\u8a55\u4fa1\u3092\u5f97\u308b\u305f\u3081\u306b\u3001\u3044\u304f\u3064\u304b\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30d8\u30c3\u30c0\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30d8\u30c3\u30c0\u306b\u306fX-Frame-Options\u3001X-Content-Type-Options\u3001Referrer Policy\u3001Content-Security-Policy\u3001\u304a\u3088\u3073X-XSS-Protection\u304c\u542b\u307e\u308c\u307e\u3059\u3002HTTP Strict Transport Security\uff08HSTS\uff09\u30d8\u30c3\u30c0\u306f\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002&#8221;preload&#8221;\u306e\u6a5f\u80fd\u3092\u7406\u89e3\u3057\u3001\u8a55\u4fa1\u3057\u305f\u5834\u5408\u306b\u306e\u307f\u6709\u52b9\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3068\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306f\u3001\u3053\u306e\u30d6\u30ed\u30c3\u30af\u306b\u3082\u914d\u7f6e\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001\u30b9\u30c6\u30c3\u30d71\u3067\u8aac\u660e\u3057\u305fWordPress\u306b\u7279\u5316\u3057\u305f\u4ed6\u306e\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u30d6\u30ed\u30c3\u30af\u3082\u3053\u306e\u30d6\u30ed\u30c3\u30af\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u7de8\u96c6\u304c\u7d42\u308f\u3063\u305f\u3089\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>Web\u30b5\u30fc\u30d0\u30fc\u30b5\u30fc\u30d3\u30b9\u3092\u518d\u4f5c\u6210\u3059\u308b\u524d\u306b\u3001Web\u30b5\u30fc\u30d0\u30fc\u30b5\u30fc\u30d3\u30b9\u5b9a\u7fa9\u306b443\u30dd\u30fc\u30c8\u30de\u30c3\u30d4\u30f3\u30b0\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>docker-compose.yml\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> docker-compose.yml<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u306e\u30b5\u30fc\u30d3\u30b9\u5b9a\u7fa9\u306b\u3001\u6b21\u306e\u30dd\u30fc\u30c8\u30de\u30c3\u30d4\u30f3\u30b0\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\n<p>\u4ee5\u4e0b\u306e\u30c6\u30ad\u30b9\u30c8\u306f\u3001\u65e5\u672c\u8a9e\u3067\u81ea\u7136\u306a\u8a00\u3044\u56de\u3057\u306b\u8a00\u3044\u63db\u3048\u3089\u308c\u307e\u3059\u3002<\/p>\n<p>\u300c~\/wordpress\/docker-compose.yml\u300d<\/p>\n<\/div>\n<pre class=\"post-pre\"><code><span class=\"token punctuation\">...<\/span>\r\n  <span class=\"token key atrule\">webserver<\/span><span class=\"token punctuation\">:<\/span>\r\n    <span class=\"token key atrule\">depends_on<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> wordpress\r\n    <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> nginx<span class=\"token punctuation\">:<\/span>1.15.12<span class=\"token punctuation\">-<\/span>alpine\r\n    <span class=\"token key atrule\">container_name<\/span><span class=\"token punctuation\">:<\/span> webserver\r\n    <span class=\"token key atrule\">restart<\/span><span class=\"token punctuation\">:<\/span> unless<span class=\"token punctuation\">-<\/span>stopped\r\n    <span class=\"token key atrule\">ports<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> <span class=\"token string\">\"80:80\"<\/span>\r\n      <span class=\"token punctuation\">-<\/span> <span class=\"token string\">\"443:443\"<\/span>\r\n    <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> wordpress<span class=\"token punctuation\">:<\/span>\/var\/www\/html\r\n      <span class=\"token punctuation\">-<\/span> .\/nginx<span class=\"token punctuation\">-<\/span>conf<span class=\"token punctuation\">:<\/span>\/etc\/nginx\/conf.d\r\n      <span class=\"token punctuation\">-<\/span> certbot<span class=\"token punctuation\">-<\/span>etc<span class=\"token punctuation\">:<\/span>\/etc\/letsencrypt\r\n    <span class=\"token key atrule\">networks<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> app<span class=\"token punctuation\">-<\/span>network\r\n<\/code><\/pre>\n<p>\u7de8\u96c6\u5f8c\u306e\u5b8c\u5168\u306a docker-compose.yml \u30d5\u30a1\u30a4\u30eb\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<div>\n<p>\u4ee5\u4e0b\u306f\u3001\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u3067\u3059\u3002\u4e00\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<p>\u300c~\/wordpress\/docker-compose.yml\u300d\u3092\u65e5\u672c\u8a9e\u306b\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u3059\u308b\u3068\u3001\u300c\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u76f4\u4e0b\u306ewordpress\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u3042\u308bdocker-compose.yml\u30d5\u30a1\u30a4\u30eb\u300d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<\/div>\n<pre class=\"post-pre\"><code><span class=\"token key atrule\">version<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">'3'<\/span>\r\n\r\n<span class=\"token key atrule\">services<\/span><span class=\"token punctuation\">:<\/span>\r\n  <span class=\"token key atrule\">db<\/span><span class=\"token punctuation\">:<\/span>\r\n    <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> mysql<span class=\"token punctuation\">:<\/span><span class=\"token number\">8.0<\/span>\r\n    <span class=\"token key atrule\">container_name<\/span><span class=\"token punctuation\">:<\/span> db\r\n    <span class=\"token key atrule\">restart<\/span><span class=\"token punctuation\">:<\/span> unless<span class=\"token punctuation\">-<\/span>stopped\r\n    <span class=\"token key atrule\">env_file<\/span><span class=\"token punctuation\">:<\/span> .env\r\n    <span class=\"token key atrule\">environment<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> MYSQL_DATABASE=wordpress\r\n    <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span> \r\n      <span class=\"token punctuation\">-<\/span> dbdata<span class=\"token punctuation\">:<\/span>\/var\/lib\/mysql\r\n    <span class=\"token key atrule\">command<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">'--default-authentication-plugin=mysql_native_password'<\/span>\r\n    <span class=\"token key atrule\">networks<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> app<span class=\"token punctuation\">-<\/span>network\r\n\r\n  <span class=\"token key atrule\">wordpress<\/span><span class=\"token punctuation\">:<\/span>\r\n    <span class=\"token key atrule\">depends_on<\/span><span class=\"token punctuation\">:<\/span> \r\n      <span class=\"token punctuation\">-<\/span> db\r\n    <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> wordpress<span class=\"token punctuation\">:<\/span>5.1.1<span class=\"token punctuation\">-<\/span>fpm<span class=\"token punctuation\">-<\/span>alpine\r\n    <span class=\"token key atrule\">container_name<\/span><span class=\"token punctuation\">:<\/span> wordpress\r\n    <span class=\"token key atrule\">restart<\/span><span class=\"token punctuation\">:<\/span> unless<span class=\"token punctuation\">-<\/span>stopped\r\n    <span class=\"token key atrule\">env_file<\/span><span class=\"token punctuation\">:<\/span> .env\r\n    <span class=\"token key atrule\">environment<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> WORDPRESS_DB_HOST=db<span class=\"token punctuation\">:<\/span><span class=\"token number\">3306<\/span>\r\n      <span class=\"token punctuation\">-<\/span> WORDPRESS_DB_USER=$MYSQL_USER\r\n      <span class=\"token punctuation\">-<\/span> WORDPRESS_DB_PASSWORD=$MYSQL_PASSWORD\r\n      <span class=\"token punctuation\">-<\/span> WORDPRESS_DB_NAME=wordpress\r\n    <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> wordpress<span class=\"token punctuation\">:<\/span>\/var\/www\/html\r\n    <span class=\"token key atrule\">networks<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> app<span class=\"token punctuation\">-<\/span>network\r\n\r\n  <span class=\"token key atrule\">webserver<\/span><span class=\"token punctuation\">:<\/span>\r\n    <span class=\"token key atrule\">depends_on<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> wordpress\r\n    <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> nginx<span class=\"token punctuation\">:<\/span>1.15.12<span class=\"token punctuation\">-<\/span>alpine\r\n    <span class=\"token key atrule\">container_name<\/span><span class=\"token punctuation\">:<\/span> webserver\r\n    <span class=\"token key atrule\">restart<\/span><span class=\"token punctuation\">:<\/span> unless<span class=\"token punctuation\">-<\/span>stopped\r\n    <span class=\"token key atrule\">ports<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> <span class=\"token string\">\"80:80\"<\/span>\r\n      <span class=\"token punctuation\">-<\/span> <span class=\"token string\">\"443:443\"<\/span>\r\n    <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> wordpress<span class=\"token punctuation\">:<\/span>\/var\/www\/html\r\n      <span class=\"token punctuation\">-<\/span> .\/nginx<span class=\"token punctuation\">-<\/span>conf<span class=\"token punctuation\">:<\/span>\/etc\/nginx\/conf.d\r\n      <span class=\"token punctuation\">-<\/span> certbot<span class=\"token punctuation\">-<\/span>etc<span class=\"token punctuation\">:<\/span>\/etc\/letsencrypt\r\n    <span class=\"token key atrule\">networks<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> app<span class=\"token punctuation\">-<\/span>network\r\n\r\n  <span class=\"token key atrule\">certbot<\/span><span class=\"token punctuation\">:<\/span>\r\n    <span class=\"token key atrule\">depends_on<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> webserver\r\n    <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> certbot\/certbot\r\n    <span class=\"token key atrule\">container_name<\/span><span class=\"token punctuation\">:<\/span> certbot\r\n    <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span>\r\n      <span class=\"token punctuation\">-<\/span> certbot<span class=\"token punctuation\">-<\/span>etc<span class=\"token punctuation\">:<\/span>\/etc\/letsencrypt\r\n      <span class=\"token punctuation\">-<\/span> wordpress<span class=\"token punctuation\">:<\/span>\/var\/www\/html\r\n    <span class=\"token key atrule\">command<\/span><span class=\"token punctuation\">:<\/span> certonly <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>webroot <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>webroot<span class=\"token punctuation\">-<\/span>path=\/var\/www\/html <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>email <mark>sammy@your_domain<\/mark> <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>agree<span class=\"token punctuation\">-<\/span>tos <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>no<span class=\"token punctuation\">-<\/span>eff<span class=\"token punctuation\">-<\/span>email <span class=\"token punctuation\">-<\/span><span class=\"token punctuation\">-<\/span>force<span class=\"token punctuation\">-<\/span>renewal <span class=\"token punctuation\">-<\/span>d <mark>your_domain<\/mark> <span class=\"token punctuation\">-<\/span>d www.<mark>your_domain<\/mark>\r\n\r\n<span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span>\r\n  <span class=\"token key atrule\">certbot-etc<\/span><span class=\"token punctuation\">:<\/span>\r\n  <span class=\"token key atrule\">wordpress<\/span><span class=\"token punctuation\">:<\/span>\r\n  <span class=\"token key atrule\">dbdata<\/span><span class=\"token punctuation\">:<\/span>\r\n\r\n<span class=\"token key atrule\">networks<\/span><span class=\"token punctuation\">:<\/span>\r\n  <span class=\"token key atrule\">app-network<\/span><span class=\"token punctuation\">:<\/span>\r\n    <span class=\"token key atrule\">driver<\/span><span class=\"token punctuation\">:<\/span> bridge  \r\n<\/code><\/pre>\n<p>\u7de8\u96c6\u304c\u7d42\u308f\u3063\u305f\u3089\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u30b5\u30fc\u30d3\u30b9\u3092\u518d\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">docker-compose<\/span> up <span class=\"token parameter variable\">-d<\/span> &#8211;force-recreate &#8211;no-deps webserver<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>docker-compose ps\u3067\u30b5\u30fc\u30d3\u30b9\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">docker-compose<\/span> <span class=\"token function\">ps<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u307e\u3059\uff081\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u307f\uff09\uff1a<br \/>\n\u51fa\u529b\u306b\u306f\u3001\u3042\u306a\u305f\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3001WordPress\u3001\u304a\u3088\u3073Web\u30b5\u30fc\u30d0\u30fc\u306e\u30b5\u30fc\u30d3\u30b9\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u793a\u3055\u308c\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Name Command State Ports &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- certbot certbot certonly &#8211;webroot &#8230; Exit 0 db docker-entrypoint.sh &#8211;def &#8230; Up 3306\/tcp, 33060\/tcp webserver nginx -g daemon off; Up 0.0.0.0:443-&gt;443\/tcp, 0.0.0.0:80-&gt;80\/tcp wordpress docker-entrypoint.sh php-fpm Up 9000\/tcp<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3042\u306a\u305f\u306e\u30b3\u30f3\u30c6\u30ca\u304c\u7a3c\u50cd\u3057\u3066\u3044\u308b\u72b6\u614b\u3067\u3001Web\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u901a\u3058\u3066WordPress\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u5b8c\u4e86\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d76 &#8212; \u30a6\u30a7\u30d6\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u4ecb\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u5b8c\u4e86\u3059\u308b<\/h2>\n<p>\u3042\u306a\u305f\u306e\u30b3\u30f3\u30c6\u30ca\u304c\u5b9f\u884c\u4e2d\u306e\u5834\u5408\u3001WordPress\u306e\u30a6\u30a7\u30d6\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u901a\u3058\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u5b8c\u4e86\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30a6\u30a7\u30d6\u30d6\u30e9\u30a6\u30b6\u30fc\u3067\u3001\u30b5\u30fc\u30d0\u30fc\u306e\u30c9\u30e1\u30a4\u30f3\u306b\u79fb\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u81ea\u5206\u306e\u30c9\u30e1\u30a4\u30f3\u540d\u306b\u300cyour_domain\u300d\u3092\u81ea\u5206\u306e\u30c9\u30e1\u30a4\u30f3\u540d\u3067\u7f6e\u304d\u63db\u3048\u308b\u3053\u3068\u3092\u5fd8\u308c\u305a\u306b\u3002<\/p>\n<pre class=\"post-pre\"><code>https:\/\/<mark>your_domain<\/mark>\r\n<\/code><\/pre>\n<p>\u3054\u5229\u7528\u306b\u306a\u308a\u305f\u3044\u8a00\u8a9e\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/65647ad7daa94e2bdf7b8d27\/168-0.png\" alt=\"WordPress Language Selector\" \/><\/div>\n<p>\u300c\u7d9a\u884c\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u30e1\u30a4\u30f3\u306e\u8a2d\u5b9a\u30da\u30fc\u30b8\u306b\u79fb\u52d5\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u3001\u30b5\u30a4\u30c8\u306e\u540d\u524d\u3068\u30e6\u30fc\u30b6\u30fc\u540d\u3092\u9078\u3076\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002&#8221;admin&#8221;\u3068\u3044\u3046\u3088\u308a\u3082\u899a\u3048\u3084\u3059\u3044\u30e6\u30fc\u30b6\u30fc\u540d\u3068\u5f37\u529b\u306a\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u9078\u3076\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002WordPress\u304c\u81ea\u52d5\u7684\u306b\u751f\u6210\u3059\u308b\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u4f7f\u7528\u3059\u308b\u304b\u3001\u72ec\u81ea\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u6700\u5f8c\u306b\u3001\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3057\u3001\u691c\u7d22\u30a8\u30f3\u30b8\u30f3\u304c\u30b5\u30a4\u30c8\u3092\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5316\u3059\u308b\u306e\u3092\u671b\u3080\u304b\u3069\u3046\u304b\u3092\u6c7a\u3081\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/65647ad7daa94e2bdf7b8d27\/171-0.png\" alt=\"WordPress Main Setup Page\" \/><\/div>\n<p>\u30da\u30fc\u30b8\u306e\u4e00\u756a\u4e0b\u306b\u3042\u308b\u300cWordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u30ed\u30b0\u30a4\u30f3\u30d7\u30ed\u30f3\u30d7\u30c8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/65647ad7daa94e2bdf7b8d27\/173-0.png\" alt=\"WordPress Login Screen\" \/><\/div>\n<p>\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u3068\u3001WordPress\u306e\u7ba1\u7406\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/65647ad7daa94e2bdf7b8d27\/175-0.png\" alt=\"WordPress Main Admin Dashboard\" \/><\/div>\n<p>WordPress\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001SSL\u8a3c\u660e\u66f8\u304c\u81ea\u52d5\u7684\u306b\u66f4\u65b0\u3055\u308c\u308b\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u306e\u624b\u9806\u3092\u8e0f\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u7b2c7\u30b9\u30c6\u30c3\u30d7 &#8211; \u8a3c\u660e\u66f8\u306e\u66f4\u65b0<\/h2>\n<p>Let&#8217;s Encrypt \u306e\u8a3c\u660e\u66f8\u306f90\u65e5\u9593\u6709\u52b9\u3067\u3059\u3002\u671f\u9650\u5207\u308c\u306b\u306a\u3089\u306a\u3044\u3088\u3046\u306b\u3001\u81ea\u52d5\u66f4\u65b0\u30d7\u30ed\u30bb\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u305d\u306e\u65b9\u6cd5\u306e\u4e00\u3064\u306f\u3001cron \u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3092\u4f7f\u7528\u3057\u3066\u30b8\u30e7\u30d6\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001\u5b9a\u671f\u7684\u306b\u5b9f\u884c\u3055\u308c\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3057\u3066\u8a3c\u660e\u66f8\u3092\u66f4\u65b0\u3057\u3001Nginx \u306e\u8a2d\u5b9a\u3092\u518d\u8aad\u307f\u8fbc\u307f\u3059\u308b cron \u30b8\u30e7\u30d6\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u306b\u3001ssl_renew.sh\u3068\u3044\u3046\u540d\u524d\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u958b\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> ssl_renew.sh<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u8ffd\u52a0\u3057\u3066\u3001\u8a3c\u660e\u66f8\u3092\u66f4\u65b0\u3057\u3001\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a\u3092\u518d\u8aad\u307f\u8fbc\u307f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4f8b\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u306f\u81ea\u5206\u306e\u975e\u30eb\u30fc\u30c8\u30e6\u30fc\u30b6\u30fc\u540d\u3067\u7f6e\u304d\u63db\u3048\u308b\u3053\u3068\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\u300c~\/wordpress\/ssl_renew.sh\u300d\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u308b\u3068\uff1a\u300c\uff5e\/wordpress\/ssl_renew.sh\u300d<\/div>\n<pre class=\"post-pre\"><code><span class=\"token shebang important\">#!\/bin\/bash<\/span>\r\n\r\n<span class=\"token assign-left variable\">COMPOSE<\/span><span class=\"token operator\">=<\/span><span class=\"token string\">\"\/usr\/local\/bin\/docker-compose --no-ansi\"<\/span>\r\n<span class=\"token assign-left variable\">DOCKER<\/span><span class=\"token operator\">=<\/span><span class=\"token string\">\"\/usr\/bin\/docker\"<\/span>\r\n\r\n<span class=\"token builtin class-name\">cd<\/span> \/home\/<mark>sammy<\/mark>\/wordpress\/\r\n<span class=\"token variable\">$COMPOSE<\/span> run certbot renew --dry-run <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token variable\">$COMPOSE<\/span> <span class=\"token function\">kill<\/span> <span class=\"token parameter variable\">-s<\/span> SIGHUP webserver\r\n<span class=\"token variable\">$DOCKER<\/span> system prune <span class=\"token parameter variable\">-af<\/span>\r\n<\/code><\/pre>\n<p>\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u3001\u6700\u521d\u306bdocker-compose\u30d0\u30a4\u30ca\u30ea\u3092COMPOSE\u3068\u3044\u3046\u5909\u6570\u306b\u5272\u308a\u5f53\u3066\u3001&#8211;no-ansi\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001docker-compose\u30b3\u30de\u30f3\u30c9\u304cANSI\u5236\u5fa1\u6587\u5b57\u306a\u3057\u3067\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u6b21\u306b\u3001docker\u30d0\u30a4\u30ca\u30ea\u3082\u540c\u69d8\u306e\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002\u6700\u5f8c\u306b\u3001~\/wordpress\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u3001\u4ee5\u4e0b\u306edocker-compose\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>docker-compose run: This will start a certbot container and override the command provided in your certbot service definition. Instead of using the certonly subcommand, the renew subcommand is used, which will renew certificates that are close to expiring. Also included is the &#8211;dry-run option to test your script.<\/li>\n<li>docker-compose kill: This will send a SIGHUP signal to the webserver container to reload the Nginx configuration.<\/li>\n<\/ul>\n<p>\u305d\u308c\u304b\u3089\u3001\u4f7f\u7528\u3055\u308c\u3066\u3044\u306a\u3044\u30b3\u30f3\u30c6\u30ca\u3068\u30a4\u30e1\u30fc\u30b8\u3092\u3059\u3079\u3066\u524a\u9664\u3059\u308b\u305f\u3081\u306b\u300cdocker system prune\u300d\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p>\u7de8\u96c6\u304c\u7d42\u4e86\u3057\u305f\u3089\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067\u5b9f\u884c\u53ef\u80fd\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">chmod<\/span> +x ssl_renew.sh<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6b21\u306b\u3001\u6307\u5b9a\u3055\u308c\u305f\u9593\u9694\u3067\u66f4\u65b0\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u3001\u30eb\u30fc\u30c8\u30af\u30ed\u30f3\u30bf\u30d6\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code>sudo crontab -e \r\n<\/code><\/pre>\n<p>\u3082\u3057\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3059\u308b\u306e\u304c\u521d\u3081\u3066\u306a\u3089\u3001\u30a8\u30c7\u30a3\u30bf\u30fc\u3092\u9078\u629e\u3059\u308b\u3088\u3046\u306b\u6c42\u3081\u3089\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>no crontab for root &#8211; using an empty one Select an editor. To change later, run &#8216;select-editor&#8217;. 1. \/bin\/nano &lt;&#8212;- easiest 2. \/usr\/bin\/vim.basic 3. \/usr\/bin\/vim.tiny 4. \/bin\/ed Choose 1-4 [1]: &#8230;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u4e00\u756a\u6700\u5f8c\u306b\u3001\u6b21\u306e\u884c\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\u30af\u30ed\u30f3\u30c8\u30fc\u30d6<\/div>\n<pre class=\"post-pre\"><code>...\r\n*\/5 * * * * \/home\/<mark>sammy<\/mark>\/wordpress\/ssl_renew.sh &gt;&gt; \/var\/log\/cron.log 2&gt;&amp;1\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u65e5\u672c\u8a9e\u3067\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u3057\u307e\u3059\uff08\uff11\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u307f\uff09\uff1a<br \/>\n\u300c\u3053\u308c\u306b\u3088\u308a\u3001\u30b8\u30e7\u30d6\u9593\u9694\u304c5\u5206\u3054\u3068\u306b\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u306e\u3067\u3001\u66f4\u65b0\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u610f\u56f3\u3057\u305f\u3088\u3046\u306b\u6a5f\u80fd\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u30c6\u30b9\u30c8\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30b8\u30e7\u30d6\u304b\u3089\u306e\u95a2\u9023\u3059\u308b\u51fa\u529b\u3092\u8a18\u9332\u3059\u308b\u305f\u3081\u306b\u3001cron.log\u3068\u3044\u3046\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002\u300d<\/p>\n<p>\uff15\u5206\u5f8c\u306bcron.log\u3092\u78ba\u8a8d\u3057\u3066\u3001\u66f4\u65b0\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u6210\u529f\u3057\u305f\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">tail<\/span> <span class=\"token parameter variable\">-f<\/span> \/var\/log\/cron.log<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u306f\u3001\u66f4\u65b0\u304c\u6210\u529f\u3057\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; ** DRY RUN: simulating &#8216;certbot renew&#8217; close to cert expiry ** (The test certificates below have not been saved.) Congratulations, all renewals succeeded. The following certs have been renewed: \/etc\/letsencrypt\/live\/<mark>your_domain<\/mark>\/fullchain.pem (success) ** DRY RUN: simulating &#8216;certbot renew&#8217; close to cert expiry ** (The test certificates above have not been saved.) &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211; &#8211;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u300cCTRL+C\u300d\u3092\u5165\u529b\u3057\u3066\u7d42\u4e86\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>cron\u30bf\u30d6\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3057\u3066\u3001\u6bce\u65e5\u306e\u9593\u9694\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u6bce\u65e5\u6b63\u5348\u306b\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u6700\u5f8c\u306e\u884c\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<div>\u30af\u30ed\u30f3\u30bf\u30d6<\/div>\n<pre class=\"post-pre\"><code>...\r\n0 12 * * * \/home\/<mark>sammy<\/mark>\/wordpress\/ssl_renew.sh &gt;&gt; \/var\/log\/cron.log 2&gt;&amp;1\r\n<\/code><\/pre>\n<p>\u3042\u306a\u305f\u306f\u307e\u305f\u3001ssl_renew.sh\u30b9\u30af\u30ea\u30d7\u30c8\u304b\u3089&#8211;dry-run\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u524a\u9664\u3057\u305f\u3044\u3068\u601d\u3046\u3067\u3057\u3087\u3046\u3002<\/p>\n<div>\u4ee5\u4e0b\u306e\u6587\u7ae0\u3092\u65e5\u672c\u8a9e\u3067\u81ea\u7136\u306a\u8a00\u3044\u56de\u3057\u306b\u8a00\u3044\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002\u305f\u3060\u3057\u30011\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u307f\u304c\u5fc5\u8981\u3067\u3059:<br \/>\n~\/wordpress\/ssl_renew.sh\u300c~\/wordpress\/ssl_renew.sh\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb<\/p>\n<\/div>\n<pre class=\"post-pre\"><code><span class=\"token shebang important\">#!\/bin\/bash<\/span>\r\n\r\n<span class=\"token assign-left variable\">COMPOSE<\/span><span class=\"token operator\">=<\/span><span class=\"token string\">\"\/usr\/local\/bin\/docker-compose --no-ansi\"<\/span>\r\n<span class=\"token assign-left variable\">DOCKER<\/span><span class=\"token operator\">=<\/span><span class=\"token string\">\"\/usr\/bin\/docker\"<\/span>\r\n\r\n<span class=\"token builtin class-name\">cd<\/span> \/home\/<mark>sammy<\/mark>\/wordpress\/\r\n<span class=\"token variable\">$COMPOSE<\/span> run certbot renew <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token variable\">$COMPOSE<\/span> <span class=\"token function\">kill<\/span> <span class=\"token parameter variable\">-s<\/span> SIGHUP webserver\r\n<span class=\"token variable\">$DOCKER<\/span> system prune <span class=\"token parameter variable\">-af<\/span>\r\n<\/code><\/pre>\n<p>\u3042\u306a\u305f\u306e\u30af\u30ed\u30f3\u30b8\u30e7\u30d6\u306f\u3001Let&#8217;s Encrypt\u8a3c\u660e\u66f8\u304c\u671f\u9650\u5207\u308c\u306b\u306a\u3089\u306a\u3044\u3088\u3046\u3001\u6709\u52b9\u671f\u9650\u304c\u8fd1\u3065\u3044\u305f\u3068\u304d\u306b\u81ea\u52d5\u7684\u306b\u66f4\u65b0\u3057\u307e\u3059\u3002\u307e\u305f\u3001Logrotate\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3092\u4f7f\u3063\u3066\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306e\u30ed\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3068\u5727\u7e2e\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Docker Compose\u3092\u4f7f\u7528\u3057\u3066Nginx\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u3092\u5099\u3048\u305fWordPress\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\u3053\u306e\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u306e\u4e00\u74b0\u3068\u3057\u3066\u3001WordPress\u30b5\u30a4\u30c8\u306b\u95a2\u9023\u4ed8\u3051\u305f\u3044\u30c9\u30e1\u30a4\u30f3\u306eTLS\/SSL\u8a3c\u660e\u66f8\u3092\u53d6\u5f97\u3057\u307e\u3057\u305f\u3002\u3055\u3089\u306b\u3001\u5fc5\u8981\u306a\u5834\u5408\u306b\u3053\u308c\u3089\u306e\u8a3c\u660e\u66f8\u3092\u66f4\u65b0\u3059\u308b\u305f\u3081\u306e\u30af\u30ed\u30f3\u30b8\u30e7\u30d6\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u30b5\u30a4\u30c8\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3068\u5197\u9577\u6027\u3092\u5411\u4e0a\u3055\u305b\u308b\u305f\u3081\u306b\u3001WordPress \u306e\u30a2\u30bb\u30c3\u30c8\u306e\u914d\u4fe1\u3068\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u306b\u95a2\u3059\u308b\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u53c2\u7167\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>How to Speed Up WordPress Asset Delivery Using Silicon Cloud Spaces CDN.<\/li>\n<li>How To Back Up a WordPress Site to Spaces.<\/li>\n<li>How To Store WordPress Assets on Silicon Cloud Spaces.<\/li>\n<\/ul>\n<p>Kubernetes\u3092\u4f7f\u7528\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u5316\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u306b\u8208\u5473\u304c\u3042\u308b\u5834\u5408\u306f\u3001\u6b21\u306e\u30ea\u30f3\u30af\u3082\u30c1\u30a7\u30c3\u30af\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<ul class=\"post-ul\">\n<li>How To Set Up WordPress with MySQL on Kubernetes Using Helm.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u4e0b\u306e\u65e5\u672c\u8a9e\u306e\u81ea\u7136\u306a\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u306f\u4e00\u3064\u3060\u3051\u3067\u3059\u3002 \u300c\u5e8f\u8ad6\u300d WordPress\u306f\u3001MySQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068PHP\u51e6\u7406\u3092\u30d9\u30fc\u30b9\u306b\u3057\u305f\u7121\u6599\u3067\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\uff08CMS\uff09\u3067\u3059\u3002\u62e1\u5f35\u53ef\u80fd\u306a\u30d7\u30e9\u30b0\u30a4\u30f3\u30a2\u30fc\u30ad\u30c6\u30af [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[17,26],"class_list":["post-505","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-17","tag-26"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Docker Compose\u3092\u4f7f\u7528\u3057\u3066WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Docker Compose\u3092\u4f7f\u7528\u3057\u3066WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\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.silicloud.com\/ja\/blog\/docker-compose\u3092\u4f7f\u7528\u3057\u3066wordpress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Docker Compose\u3092\u4f7f\u7528\u3057\u3066WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002\" \/>\n<meta property=\"og:description\" content=\"Docker Compose\u3092\u4f7f\u7528\u3057\u3066WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/docker-compose\u3092\u4f7f\u7528\u3057\u3066wordpress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-23T06:42:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T15:06:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/65647ad7daa94e2bdf7b8d27\/168-0.png\" \/>\n<meta name=\"author\" content=\"\u6d77\u6597, \u8475\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6d77\u6597, \u8475\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"79\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/docker-compose%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6wordpress%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95%e3%82%92%e6%95%99%e3%81%88\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/docker-compose%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6wordpress%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95%e3%82%92%e6%95%99%e3%81%88\/\",\"name\":\"Docker Compose\u3092\u4f7f\u7528\u3057\u3066WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2023-04-23T06:42:21+00:00\",\"dateModified\":\"2025-07-31T15:06:35+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6\"},\"description\":\"Docker Compose\u3092\u4f7f\u7528\u3057\u3066WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/docker-compose%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6wordpress%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95%e3%82%92%e6%95%99%e3%81%88\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/docker-compose%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6wordpress%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95%e3%82%92%e6%95%99%e3%81%88\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/docker-compose%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6wordpress%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95%e3%82%92%e6%95%99%e3%81%88\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Docker Compose\u3092\u4f7f\u7528\u3057\u3066WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6\",\"name\":\"\u6d77\u6597, \u8475\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g\",\"caption\":\"\u6d77\u6597, \u8475\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/kaitoaoi\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/docker-compose%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6wordpress%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95%e3%82%92%e6%95%99%e3%81%88\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Docker Compose\u3092\u4f7f\u7528\u3057\u3066WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002 - Blog - Silicon Cloud","description":"Docker Compose\u3092\u4f7f\u7528\u3057\u3066WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","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.silicloud.com\/ja\/blog\/docker-compose\u3092\u4f7f\u7528\u3057\u3066wordpress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\/","og_locale":"ja_JP","og_type":"article","og_title":"Docker Compose\u3092\u4f7f\u7528\u3057\u3066WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002","og_description":"Docker Compose\u3092\u4f7f\u7528\u3057\u3066WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/docker-compose\u3092\u4f7f\u7528\u3057\u3066wordpress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-04-23T06:42:21+00:00","article_modified_time":"2025-07-31T15:06:35+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/65647ad7daa94e2bdf7b8d27\/168-0.png"}],"author":"\u6d77\u6597, \u8475","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u6d77\u6597, \u8475","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"79\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/docker-compose%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6wordpress%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95%e3%82%92%e6%95%99%e3%81%88\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/docker-compose%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6wordpress%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95%e3%82%92%e6%95%99%e3%81%88\/","name":"Docker Compose\u3092\u4f7f\u7528\u3057\u3066WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2023-04-23T06:42:21+00:00","dateModified":"2025-07-31T15:06:35+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6"},"description":"Docker Compose\u3092\u4f7f\u7528\u3057\u3066WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/docker-compose%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6wordpress%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95%e3%82%92%e6%95%99%e3%81%88\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/docker-compose%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6wordpress%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95%e3%82%92%e6%95%99%e3%81%88\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/docker-compose%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6wordpress%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95%e3%82%92%e6%95%99%e3%81%88\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Docker Compose\u3092\u4f7f\u7528\u3057\u3066WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6","name":"\u6d77\u6597, \u8475","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g","caption":"\u6d77\u6597, \u8475"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/kaitoaoi\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/docker-compose%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6wordpress%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95%e3%82%92%e6%95%99%e3%81%88\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/505","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=505"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/505\/revisions"}],"predecessor-version":[{"id":41477,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/505\/revisions\/41477"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}